-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
4072 lines (3973 loc) · 154 KB
/
Makefile
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
dump_wq_%:
java -cp lib/*:bin deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
preprocess.capitalizeFirstWord true \
preprocess.capitalizeEntities true \
languageCode $* \
posTagKey UD \
nthreads 1 \
< data/WebQuestions/$*/$*-bilty-bist-webquestions.train.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
> working/$*-wq-train.conll.srl.tmp
cut -f2 working/$*-wq-train.conll.srl.tmp \
| sed -e 's/^/\t/g' \
> working/$*-wq-train.conll.srl.input
java -cp lib/*:bin deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
preprocess.capitalizeFirstWord true \
preprocess.capitalizeEntities true \
languageCode $* \
posTagKey UD \
nthreads 1 \
< data/WebQuestions/$*/$*-bilty-bist-webquestions.test.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
> working/$*-wq-test.conll.srl.tmp
cut -f2 working/$*-wq-test.conll.srl.tmp \
| sed -e 's/^/\t/g' \
> working/$*-wq-test.conll.srl.input
java -cp lib/*:bin deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
preprocess.capitalizeFirstWord true \
preprocess.capitalizeEntities true \
languageCode $* \
posTagKey UD \
nthreads 1 \
< data/WebQuestions/$*/$*-bilty-bist-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
> working/$*-wq-dev.conll.srl.tmp
cut -f2 working/$*-wq-dev.conll.srl.tmp \
| sed -e 's/^/\t/g' \
> working/$*-wq-dev.conll.srl.input
correct-args-using-srl_%:
python scripts/modify-arg1-arg2-srl.py \
data/WebQuestions/$*/$*-bilty-bist-webquestions.train.deplambda.json \
working/$*-wq-train.conll.srl.output \
> data/WebQuestions/$*/$*-bilty-bist-srl-webquestions.train.deplambda.json
python scripts/modify-arg1-arg2-srl.py \
data/WebQuestions/$*/$*-bilty-bist-webquestions.dev.deplambda.json \
working/$*-wq-dev.conll.srl.output \
> data/WebQuestions/$*/$*-bilty-bist-srl-webquestions.dev.deplambda.json
python scripts/modify-arg1-arg2-srl.py \
data/WebQuestions/$*/$*-bilty-bist-webquestions.test.deplambda.json \
working/$*-wq-test.conll.srl.output \
> data/WebQuestions/$*/$*-bilty-bist-srl-webquestions.test.deplambda.json
# Compiles protos and creates source code.
compile_protos:
protoc -I=protos --java -Dfile.encoding="UTF-8"_out=src protos/transformation-rules.proto
# Full commands of a language
create_data_%:
make create_webquestions_$*
make entity_annotate_webquestions_$*
create_tagging_data_%:
make entity_dismabiguated_to_plain_forest_$*
make plain_forest_to_conll_$*
# At this point run the pos tagger and save its output
create_parsing_data_%:
make process_postagger_$*
make tagged_forest_to_conll_$*
# At this point run the dependency parser
create_deplambda_data_%:
make merge_parsed_conll_with_forest_$*
make deplambda_forest_$*
# Run BoW experiments
run_bow_experiments_%:
#make extract_gold_graphs_bow_dev_$*
make extract_gold_graphs_bow_$*
make bow_supervised_without_merge_without_expand_$*
# Run dependency experiments
run_dependency_experiments_%:
#make extract_gold_graphs_dependency_dev_$*
make extract_gold_graphs_dependency_$*
make dependency_with_merge_without_expand_$*
make test_dependency_with_merge_without_expand_$*
make dependency_without_merge_without_expand_$*
# Run deplambda experiments
run_deplambda_experiments_%:
#make extract_gold_graphs_deplambda_dev_$*
make extract_gold_graphs_deplambda_$*
make deplambda_with_merge_with_expand.32_$*
#make deplambda_with_merge_with_expand.31_$*
#make deplambda_with_merge_with_expand.32.stem_$*
#make test_deplambda_with_merge_with_expand_$*
#make deplambda_with_merge_without_expand_$*
#make deplambda_without_merge_with_expand_$*
#make deplambda_without_merge_without_expand_$*
run_deplambda_hyperexpand_%:
make extract_gold_graphs_deplambda_hyperexpand_$*
make deplambda_with_hyperexpand.32_$*
#make deplambda_with_hyperexpand.31_$*
run_dependency_hyperexpand_%:
make extract_gold_graphs_dependency_hyperexpand_$*
make dependency_with_hyperexpand.32_$*
# TODO: Just use the model in the best iteration for testing.
run_tests_%:
make lang_run_tests_$*-1
make lang_run_tests_$*-2
make lang_run_tests_$*-3
lang_run_tests_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
$(eval RUN := $(shell echo $* | cut -d- -f2))
make get_test_results_$(LANG)-bilty-bist
mv ../working/test_bow_supervised_without_merge_without_expand_$(LANG)-bilty-bist \
../working/test_bow_supervised_without_merge_without_expand_$(LANG)-bilty-bist.$(RUN)
mv ../working/test_deplambda_with_hyperexpand.32_$(LANG)-bilty-bist \
../working/test_deplambda_with_hyperexpand.32_$(LANG)-bilty-bist.$(RUN)
mv ../working/test_dependency_with_hyperexpand.32_$(LANG)-bilty-bist \
../working/test_dependency_with_hyperexpand.32_$(LANG)-bilty-bist.$(RUN)
get_test_results_%:
make test_bow_supervised_without_merge_without_expand_$*
make test_deplambda_with_hyperexpand.32_$*
make test_dependency_with_hyperexpand.32_$*
# Data Preparation
# Parse WebQuestions
create_webquestions_en:
cat data/WebQuestions/en/webquestions.examples.test.json \
| python scripts/webquestions/convert_to_one_sentence_per_line.py \
| python scripts/webquestions/add_gold_mid_using_gold_url.py data/freebase/mid_to_key.txt.gz \
| java -Dfile.encoding="UTF-8" -cp lib/*: in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
> data/WebQuestions/en/webquestions.test.json
cat data/WebQuestions/en/webquestions.examples.train.json \
| python scripts/webquestions/convert_to_one_sentence_per_line.py \
| python scripts/webquestions/extract_subset.py data/WebQuestions/webquestions_sentences.train.txt \
| python scripts/webquestions/add_gold_mid_using_gold_url.py data/freebase/mid_to_key.txt.gz \
| java -Dfile.encoding="UTF-8" -cp lib/*: in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
> data/WebQuestions/en/webquestions.train.json
cat data/WebQuestions/en/webquestions.examples.train.json \
| python scripts/webquestions/convert_to_one_sentence_per_line.py \
| python scripts/webquestions/extract_subset.py data/WebQuestions/webquestions_sentences.dev.txt \
| python scripts/webquestions/add_gold_mid_using_gold_url.py data/freebase/mid_to_key.txt.gz \
| java -Dfile.encoding="UTF-8" -cp lib/*: in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
> data/WebQuestions/en/webquestions.dev.json
create_webquestions_%:
cat data/WebQuestions/en/webquestions.train.json \
| python scripts/webquestions/merge_with_english.py \
data/WebQuestions/$*/webquestions.examples.train.utterances_$* \
data/WebQuestions/$*/webquestions.examples.train.utterances \
> data/WebQuestions/$*/webquestions.train.json
cat data/WebQuestions/en/webquestions.dev.json \
| python scripts/webquestions/merge_with_english.py \
data/WebQuestions/$*/webquestions.examples.train.utterances_$* \
data/WebQuestions/$*/webquestions.examples.train.utterances \
> data/WebQuestions/$*/webquestions.dev.json
cat data/WebQuestions/en/webquestions.test.json \
| python scripts/webquestions/merge_with_english.py \
data/WebQuestions/$*/webquestions.examples.test.utterances_$* \
data/WebQuestions/$*/webquestions.examples.test.utterances \
> data/WebQuestions/$*/webquestions.test.json
entity_annotate_webquestions_%:
cat data/WebQuestions/$*/webquestions.train.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit,pos,lemma \
ssplit.newlineIsSentenceBreak always \
languageCode $* \
pos.model lib_data/ud-models-v1.2/$*/pos-tagger/utb-caseless-$*-bidirectional-glove-distsim-lower.full.tagger \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.NounPhraseAnnotator $*_ud \
> working/$*-webquestions.train.json
cat data/WebQuestions/$*/webquestions.dev.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit,pos,lemma \
ssplit.newlineIsSentenceBreak always \
languageCode $* \
pos.model lib_data/ud-models-v1.2/$*/pos-tagger/utb-caseless-$*-bidirectional-glove-distsim-lower.full.tagger \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.NounPhraseAnnotator $*_ud \
> working/$*-webquestions.dev.json
cat data/WebQuestions/$*/webquestions.test.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit,pos,lemma \
ssplit.newlineIsSentenceBreak always \
languageCode $* \
pos.model lib_data/ud-models-v1.2/$*/pos-tagger/utb-caseless-$*-bidirectional-glove-distsim-lower.full.tagger \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.NounPhraseAnnotator $*_ud \
> working/$*-webquestions.test.json
# Entity Annotations
cat working/$*-webquestions.dev.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.graphparser.cli.RankMatchedEntitiesCli \
--useKG false \
--apiKey AIzaSyDj-4Sr5TmDuEA8UVOd_89PqK87GABeoFg \
--langCode $* \
> working/$*-webquestions.dev.ranked.json
cat working/$*-webquestions.test.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.graphparser.cli.RankMatchedEntitiesCli \
--useKG false \
--apiKey AIzaSyDj-4Sr5TmDuEA8UVOd_89PqK87GABeoFg \
--langCode $* \
> working/$*-webquestions.test.ranked.json
cat working/$*-webquestions.train.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.graphparser.cli.RankMatchedEntitiesCli \
--useKG false \
--apiKey AIzaSyDj-4Sr5TmDuEA8UVOd_89PqK87GABeoFg \
--langCode $* \
> working/$*-webquestions.train.ranked.json
# if successful, take backup. Freebase API may stop working anytime.
#echo "Overwriting existing files: "
cp -i working/$*-webquestions.train.ranked.json data/WebQuestions/$*/webquestions.train.ranked.json
cp -i working/$*-webquestions.dev.ranked.json data/WebQuestions/$*/webquestions.dev.ranked.json
cp -i working/$*-webquestions.test.ranked.json data/WebQuestions/$*/webquestions.test.ranked.json
evaluate_entity_annotation_upperbound_%:
cat data/WebQuestions/$*/webquestions.dev.ranked.json \
| python2.7 ../graph-parser/scripts/entity-annotation/get_entity_patterns.py
train_entity_annotator_%:
mkdir -p data/entity-models
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunTrainEntityScorer \
-nthreads 20 \
-iterations 100 \
-trainFile data/WebQuestions/$*/webquestions.train.ranked.json \
-devFile data/WebQuestions/$*/webquestions.dev.ranked.json \
-testFile data/WebQuestions/$*/webquestions.test.ranked.json \
-saveToFile data/entity-models/$*-webquestions.ser
disambiguate_entities_%:
cat data/WebQuestions/$*/webquestions.dev.ranked.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunEntityDisambiguator \
-loadModelFromFile data/entity-models/$*-webquestions.ser \
-endpoint localhost \
-nthreads 20 \
-nbestEntities 10 \
-schema data/freebase/schema/all_domains_schema.txt \
> data/WebQuestions/$*/webquestions.dev.disambiguated.json
cat data/WebQuestions/$*/webquestions.train.ranked.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunEntityDisambiguator \
-loadModelFromFile data/entity-models/$*-webquestions.ser \
-endpoint localhost \
-nthreads 20 \
-nbestEntities 10 \
-schema data/freebase/schema/all_domains_schema.txt \
> data/WebQuestions/$*/webquestions.train.disambiguated.json
cat data/WebQuestions/$*/webquestions.test.ranked.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunEntityDisambiguator \
-loadModelFromFile data/entity-models/$*-webquestions.ser \
-endpoint localhost \
-nthreads 20 \
-nbestEntities 10 \
-schema data/freebase/schema/all_domains_schema.txt \
> data/WebQuestions/$*/webquestions.test.disambiguated.json
entity_disambiguation_results_%:
cat data/WebQuestions/$*/webquestions.dev.disambiguated.json \
| python2.7 ../graph-parser/scripts/entity-annotation/evaluate_entity_annotation.py
entity_dismabiguated_to_plain_forest_en:
cat data/WebQuestions/en/webquestions.dev.disambiguated.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos,lemma \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.2/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.full.tagger \
> working/en-webquestions.dev.plain.forest.json
cat data/WebQuestions/en/webquestions.train.disambiguated.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos,lemma \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.2/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.full.tagger \
> working/en-webquestions.train.plain.forest.json
cat data/WebQuestions/en/webquestions.test.disambiguated.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos,lemma \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.2/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.full.tagger \
> working/en-webquestions.test.plain.forest.json
entity_dismabiguated_to_plain_forest_%:
cat data/WebQuestions/$*/webquestions.dev.disambiguated.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode $* \
posTagKey UD \
pos.model lib_data/ud-models-v1.2/$*/pos-tagger/utb-caseless-$*-bidirectional-glove-distsim-lower.full.tagger \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.Stemmer $* 20 \
> working/$*-webquestions.dev.plain.forest.json
cat data/WebQuestions/$*/webquestions.train.disambiguated.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode $* \
posTagKey UD \
pos.model lib_data/ud-models-v1.2/$*/pos-tagger/utb-caseless-$*-bidirectional-glove-distsim-lower.full.tagger \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.Stemmer $* 20 \
> working/$*-webquestions.train.plain.forest.json
cat data/WebQuestions/$*/webquestions.test.disambiguated.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode $* \
posTagKey UD \
pos.model lib_data/ud-models-v1.2/$*/pos-tagger/utb-caseless-$*-bidirectional-glove-distsim-lower.full.tagger \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.Stemmer $* 20 \
> working/$*-webquestions.test.plain.forest.json
easyccg_parse_%:
cat working/en-webquestions.$*.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
preprocess.addDateEntities true \
preprocess.capitalizeFirstWord true \
preprocess.capitalizeEntities true \
preprocess.mergeEntityWords true \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
languageCode en \
ssplit.eolonly true \
nthreads 10 \
postprocess.correctPosTags true \
posTagKey PTB \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
nthreads 10 \
ccgParser easyccg \
ccgParser.nbest 1 \
ccgParser.modelFolder ../graph-parser/lib_data/easyccg_model_questions/ \
ccgParser.parserArguments -s,-r,S[q],S[qem],S[wq] \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
nthreads 10 \
ccgParser easyccg \
ccgParser.nbest 1 \
ccgParser.modelFolder ../graph-parser/lib_data/easyccg_model/ \
ccgParser.parserArguments -s,-r,S[q],S[qem],S[wq] \
> working/en-webquestions.$*.easyccg.json
plain_forest_to_conll_%:
cat working/$*-webquestions.dev.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
| sed -e "s/-lrb-/\(/g" \
| sed -e "s/-rrb-/\)/g" \
| sed -e "s/-RRB-/SYM/g" \
| sed -e "s/-LRB-/SYM/g" \
| python scripts/webquestions/make_conll_column_lowercase.py 1 \
> working/$*-webquestions.dev.forest.conll
cp working/$*-webquestions.dev.forest.conll working/$*-stanford-webquestions.dev.forest.tagged.conll
cat working/$*-webquestions.train.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
| sed -e "s/-lrb-/\(/g" \
| sed -e "s/-rrb-/\)/g" \
| sed -e "s/-RRB-/SYM/g" \
| sed -e "s/-LRB-/SYM/g" \
| python scripts/webquestions/make_conll_column_lowercase.py 1 \
> working/$*-webquestions.train.forest.conll
cp working/$*-webquestions.train.forest.conll working/$*-stanford-webquestions.train.forest.tagged.conll
cat working/$*-webquestions.test.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
| sed -e "s/-lrb-/\(/g" \
| sed -e "s/-rrb-/\)/g" \
| sed -e "s/-RRB-/SYM/g" \
| sed -e "s/-LRB-/SYM/g" \
| python scripts/webquestions/make_conll_column_lowercase.py 1 \
> working/$*-webquestions.test.forest.conll
cp working/$*-webquestions.test.forest.conll working/$*-stanford-webquestions.test.forest.tagged.conll
process_postagger_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
python scripts/webquestions/copy_column_from_to.py 3:3,3:4 \
working/$*-webquestions.dev.forest.tagged.conll \
working/$(LANG)-webquestions.dev.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.dev.forest.tmp.conll
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.MergeConllAndGraphParserFormats \
working/$*-webquestions.dev.forest.tmp.conll \
working/$(LANG)-webquestions.dev.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
preprocess.addDateEntities true \
preprocess.mergeEntityWords true \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode $* \
posTagKey UD \
postprocess.correctPosTags true \
> working/$*-webquestions.dev.forest.json
rm working/$*-webquestions.dev.forest.tmp.conll
python scripts/webquestions/copy_column_from_to.py 3:3,3:4 \
working/$*-webquestions.train.forest.tagged.conll \
working/$(LANG)-webquestions.train.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.train.forest.tmp.conll
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.MergeConllAndGraphParserFormats \
working/$*-webquestions.train.forest.tmp.conll \
working/$(LANG)-webquestions.train.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
preprocess.addDateEntities true \
preprocess.mergeEntityWords true \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode $* \
posTagKey UD \
postprocess.correctPosTags true \
> working/$*-webquestions.train.forest.json
rm working/$*-webquestions.train.forest.tmp.conll
python scripts/webquestions/copy_column_from_to.py 3:3,3:4 \
working/$*-webquestions.test.forest.tagged.conll \
working/$(LANG)-webquestions.test.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.test.forest.tmp.conll
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.MergeConllAndGraphParserFormats \
working/$*-webquestions.test.forest.tmp.conll \
working/$(LANG)-webquestions.test.plain.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
preprocess.addDateEntities true \
preprocess.mergeEntityWords true \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode $* \
posTagKey UD \
postprocess.correctPosTags true \
> working/$*-webquestions.test.forest.json
rm working/$*-webquestions.test.forest.tmp.conll
tagged_forest_to_conll_%:
cat working/$*-webquestions.dev.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
| sed -e "s/-lrb-/\(/g" \
| sed -e "s/-rrb-/\)/g" \
| sed -e "s/-RRB-/SYM/g" \
| sed -e "s/-LRB-/SYM/g" \
| python scripts/webquestions/make_conll_column_lowercase.py 1 \
| python scripts/webquestions/copy_coarse_pos_to_fine_pos.py \
> working/$*-webquestions.dev.forest.conll
cat working/$*-webquestions.train.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
| sed -e "s/-lrb-/\(/g" \
| sed -e "s/-rrb-/\)/g" \
| sed -e "s/-RRB-/SYM/g" \
| sed -e "s/-LRB-/SYM/g" \
| python scripts/webquestions/make_conll_column_lowercase.py 1 \
| python scripts/webquestions/copy_coarse_pos_to_fine_pos.py \
> working/$*-webquestions.train.forest.conll
cat working/$*-webquestions.test.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.ConvertGraphParserSentenceToConll \
| sed -e "s/-lrb-/\(/g" \
| sed -e "s/-rrb-/\)/g" \
| sed -e "s/-RRB-/SYM/g" \
| sed -e "s/-LRB-/SYM/g" \
| python scripts/webquestions/make_conll_column_lowercase.py 1 \
| python scripts/webquestions/copy_coarse_pos_to_fine_pos.py \
> working/$*-webquestions.test.forest.conll
forest_to_sentences_%:
mkdir -p working/webq_multillingual_graphpaser_constrained_entity_annotations/sent/$*
cat working/$*-webquestions.dev.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.PrintSentencesFromWords \
> working/webq_multillingual_graphpaser_constrained_entity_annotations/sent/$*/webquestions.dev.sentences.txt
cat working/$*-webquestions.train.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.PrintSentencesFromWords \
_tree> working/webq_multillingual_graphpaser_constrained_entity_annotations/sent/$*/webquestions.train.sentences.txt
cat working/$*-webquestions.test.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.PrintSentencesFromWords \
> working/webq_multillingual_graphpaser_constrained_entity_annotations/sent/$*/webquestions.test.sentences.txt
stanford_parse_conll_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat working/$*-webquestions.dev.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.dev.forest.conll.tmp
java -Dfile.encoding="UTF-8" -cp .:lib/* edu.stanford.nlp.parser.nndep.DependencyParser \
-model lib_data/ud-models-v1.3/$(LANG)/neural-parser/$(LANG)-lowercase-glove50.lower.nndep.model.txt.gz \
-testFile working/$*-webquestions.dev.forest.conll.tmp \
-outFile working/$*-stanford-webquestions.dev.forest.parsed.conll
rm working/$*-webquestions.dev.forest.conll.tmp
cat working/$*-webquestions.train.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.train.forest.conll.tmp
java -Dfile.encoding="UTF-8" -cp .:lib/* edu.stanford.nlp.parser.nndep.DependencyParser \
-model lib_data/ud-models-v1.3/$(LANG)/neural-parser/$(LANG)-lowercase-glove50.lower.nndep.model.txt.gz \
-testFile working/$*-webquestions.train.forest.conll.tmp \
-outFile working/$*-stanford-webquestions.train.forest.parsed.conll
rm working/$*-webquestions.train.forest.conll.tmp
cat working/$*-webquestions.test.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.test.forest.conll.tmp
java -Dfile.encoding="UTF-8" -cp .:lib/* edu.stanford.nlp.parser.nndep.DependencyParser \
-model lib_data/ud-models-v1.3/$(LANG)/neural-parser/$(LANG)-lowercase-glove50.lower.nndep.model.txt.gz \
-testFile working/$*-webquestions.test.forest.conll.tmp \
-outFile working/$*-stanford-webquestions.test.forest.parsed.conll
rm working/$*-webquestions.test.forest.conll.tmp
stanford_bilty_parse_conll_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat working/$*-webquestions.dev.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.dev.forest.conll.tmp
java -Dfile.encoding="UTF-8" -cp .:lib/* edu.stanford.nlp.parser.nndep.DependencyParser \
-model lib_data/ud-models-v1.3/$(LANG)-bilty/neural-parser/$(LANG)-bilty-glove50.lower.nndep.model.txt.gz \
-testFile working/$*-webquestions.dev.forest.conll.tmp \
-outFile working/$*-stanford-webquestions.dev.forest.parsed.conll
rm working/$*-webquestions.dev.forest.conll.tmp
cat working/$*-webquestions.train.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.train.forest.conll.tmp
java -Dfile.encoding="UTF-8" -cp .:lib/* edu.stanford.nlp.parser.nndep.DependencyParser \
-model lib_data/ud-models-v1.3/$(LANG)-bilty/neural-parser/$(LANG)-bilty-glove50.lower.nndep.model.txt.gz \
-testFile working/$*-webquestions.train.forest.conll.tmp \
-outFile working/$*-stanford-webquestions.train.forest.parsed.conll
rm working/$*-webquestions.train.forest.conll.tmp
cat working/$*-webquestions.test.forest.conll \
| sed -e 's/_\t_\t_\t_$$/0\troot\t_\t_/g' \
> working/$*-webquestions.test.forest.conll.tmp
java -Dfile.encoding="UTF-8" -cp .:lib/* edu.stanford.nlp.parser.nndep.DependencyParser \
-model lib_data/ud-models-v1.3/$(LANG)-bilty/neural-parser/$(LANG)-bilty-glove50.lower.nndep.model.txt.gz \
-testFile working/$*-webquestions.test.forest.conll.tmp \
-outFile working/$*-stanford-webquestions.test.forest.parsed.conll
rm working/$*-webquestions.test.forest.conll.tmp
merge_parsed_conll_with_forest_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
$(eval TAGGER := $(shell echo $* | cut -d- -f1,2))
python scripts/webquestions/copy_column_from_to.py 2:2 \
working/$(TAGGER)-webquestions.dev.forest.conll \
working/$*-webquestions.dev.forest.parsed.conll \
> working/$*-webquestions.dev.forest.parsed.tmp.conll
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.MergeConllAndGraphParserFormats \
working/$*-webquestions.dev.forest.parsed.tmp.conll \
working/$(TAGGER)-webquestions.dev.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
ssplit.newlineIsSentenceBreak always \
tokenize.whitespace true \
postprocess.removeMultipleRoots true \
languageCode $(LANG) \
> working/$*-webquestions.dev.forest.parsed.json
rm working/$*-webquestions.dev.forest.parsed.tmp.conll \
python scripts/webquestions/copy_column_from_to.py 2:2 \
working/$(TAGGER)-webquestions.train.forest.conll \
working/$*-webquestions.train.forest.parsed.conll \
> working/$*-webquestions.train.forest.parsed.tmp.conll
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.MergeConllAndGraphParserFormats \
working/$*-webquestions.train.forest.parsed.tmp.conll \
working/$(TAGGER)-webquestions.train.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
ssplit.newlineIsSentenceBreak always \
tokenize.whitespace true \
postprocess.removeMultipleRoots true \
languageCode $(LANG) \
> working/$*-webquestions.train.forest.parsed.json
rm working/$*-webquestions.train.forest.parsed.tmp.conll \
python scripts/webquestions/copy_column_from_to.py 2:2 \
working/$(TAGGER)-webquestions.test.forest.conll \
working/$*-webquestions.test.forest.parsed.conll \
> working/$*-webquestions.test.forest.parsed.tmp.conll
java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.MergeConllAndGraphParserFormats \
working/$*-webquestions.test.forest.parsed.tmp.conll \
working/$(TAGGER)-webquestions.test.forest.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.others.NlpPipeline \
annotators tokenize,ssplit \
ssplit.newlineIsSentenceBreak always \
tokenize.whitespace true \
postprocess.removeMultipleRoots true \
languageCode $(LANG) \
> working/$*-webquestions.test.forest.parsed.json
rm working/$*-webquestions.test.forest.parsed.tmp.conll \
deplambda_forest_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat working/$*-webquestions.train.forest.parsed.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunForestTransformer \
-definedTypesFile lib_data/ud.types.txt \
-treeTransformationsFile lib_data/ud-enhancement-rules.proto \
-relationPrioritiesFile lib_data/ud-obliqueness-hierarchy.proto \
-lambdaAssignmentRulesFile lib_data/ud-substitution-rules.no_aggregation.proto \
-nthreads 20 \
| python scripts/dependency_semantic_parser/remove_spurious_predicates_from_forest.py \
> data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json
cat working/$*-webquestions.dev.forest.parsed.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunForestTransformer \
-definedTypesFile lib_data/ud.types.txt \
-treeTransformationsFile lib_data/ud-enhancement-rules.proto \
-relationPrioritiesFile lib_data/ud-obliqueness-hierarchy.proto \
-lambdaAssignmentRulesFile lib_data/ud-substitution-rules.no_aggregation.proto \
-nthreads 20 \
| python scripts/dependency_semantic_parser/remove_spurious_predicates_from_forest.py \
> data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json
cat working/$*-webquestions.test.forest.parsed.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* deplambda.cli.RunForestTransformer \
-definedTypesFile lib_data/ud.types.txt \
-treeTransformationsFile lib_data/ud-enhancement-rules.proto \
-relationPrioritiesFile lib_data/ud-obliqueness-hierarchy.proto \
-lambdaAssignmentRulesFile lib_data/ud-substitution-rules.no_aggregation.proto \
-nthreads 20 \
| python scripts/dependency_semantic_parser/remove_spurious_predicates_from_forest.py \
> data/WebQuestions/$(LANG)/$*-webquestions.test.deplambda.json
merge_stanford_bistnopos_%:
java -Dfile.encoding="UTF-8" -cp bin/:lib/* deplambda.others.MergeTwoForestsIfDisconnected \
working/$*-bistnopos-webquestions.dev.forest.deplambda.json \
< working/$*-stanford-webquestions.dev.forest.deplambda.json \
> working/$*-stanford-bistnopos-webquestions.dev.forest.deplambda.json
java -Dfile.encoding="UTF-8" -cp bin/:lib/* deplambda.others.MergeTwoForestsIfDisconnected \
working/$*-bistnopos-webquestions.train.forest.deplambda.json \
< working/$*-stanford-webquestions.train.forest.deplambda.json \
> working/$*-stanford-bistnopos-webquestions.train.forest.deplambda.json
java -Dfile.encoding="UTF-8" -cp bin/:lib/* deplambda.others.MergeTwoForestsIfDisconnected \
working/$*-bistnopos-webquestions.test.forest.deplambda.json \
< working/$*-stanford-webquestions.test.forest.deplambda.json \
> working/$*-stanford-bistnopos-webquestions.test.forest.deplambda.json
extract_gold_graphs_bow_dev_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
mkdir -p data/gold_graphs/
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
bow_question_graph \
data/gold_graphs/$*_bow_without_merge_without_expand.dev \
lib_data/dummy.txt \
false \
false \
> data/gold_graphs/$*_bow_without_merge_without_expand.dev.answers.txt
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.stanford.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
bow_question_graph \
data/gold_graphs/$*_bow_with_merge_without_expand.dev \
lib_data/dummy.txt \
true \
false \
> data/gold_graphs/$*_bow_with_merge_without_expand.dev.answers.txt
extract_gold_graphs_bow_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
mkdir -p data/gold_graphs/
cat data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json \
data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
bow_question_graph \
data/gold_graphs/$*_bow_without_merge_without_expand.full \
lib_data/dummy.txt \
false \
false \
> data/gold_graphs/$*_bow_without_merge_without_expand.full.answers.txt
#cat working/$*-stanford-webquestions.train.deplambda.json \
# working/$*-stanford-webquestions.dev.deplambda.json \
#| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
# data/freebase/schema/all_domains_schema.txt localhost \
# bow_question_graph \
# data/gold_graphs/$*_bow_with_merge_without_expand.full \
# lib_data/dummy.txt \
# true \
# false \
# > data/gold_graphs/$*_bow_with_merge_without_expand.full.answers.txt
extract_gold_graphs_dependency_dev_%:
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_question_graph \
data/gold_graphs/$*_dependency_without_merge_without_expand.dev \
lib_data/dummy.txt \
false \
false \
> data/gold_graphs/$*_dependency_without_merge_without_expand.dev.answers.txt
cat working/$*-webquestions.dev.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_question_graph \
data/gold_graphs/$*_dependency_with_merge_without_expand.dev \
lib_data/dummy.txt \
true \
false \
> data/gold_graphs/$*_dependency_with_merge_without_expand.dev.answers.txt
extract_gold_graphs_dependency_hyperexpand_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json \
data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_question_graph \
data/gold_graphs/$*_dependency_with_hyperexpand.full \
lib_data/dummy.txt \
false \
false \
true \
> data/gold_graphs/$*_dependency_with_hyperexpand.full.answers.txt
extract_gold_graphs_dependency_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
#cat data/WebQuestions/$(LANG)/$*-webquestions.train.json \
# data/WebQuestions/$(LANG)/$*-webquestions.dev.json \
#| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
# data/freebase/schema/all_domains_schema.txt localhost \
# dependency_question_graph \
# data/gold_graphs/$*_dependency_without_merge_without_expand.full \
# lib_data/dummy.txt \
# false \
# false \
# > data/gold_graphs/$*_dependency_without_merge_without_expand.full.answers.txt
cat data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json \
data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_question_graph \
data/gold_graphs/$*_dependency_with_merge_without_expand.full \
lib_data/dummy.txt \
true \
false \
> data/gold_graphs/$*_dependency_with_merge_without_expand.full.answers.txt
extract_gold_graphs_deplambda_dev_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/$*_deplambda_with_merge_with_expand.dev \
lib_data/dummy.txt \
true \
true \
> data/gold_graphs/$*_deplambda_with_merge_with_expand.dev.answers.txt
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/$*_deplambda_without_merge_with_expand.dev \
lib_data/dummy.txt \
false \
true \
> data/gold_graphs/$*_deplambda_without_merge_with_expand.dev.answers.txt
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/$*_deplambda_with_merge_without_expand.dev \
lib_data/dummy.txt \
true \
false \
> data/gold_graphs/$*_deplambda_with_merge_without_expand.dev.answers.txt
cat data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/$*_deplambda_without_merge_without_expand.dev \
lib_data/dummy.txt \
false \
false \
> data/gold_graphs/$*_deplambda_without_merge_without_expand.dev.answers.txt
extract_gold_graphs_deplambda_hyperexpand_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json \
data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/$*_deplambda_with_hyperexpand.full \
lib_data/dummy.txt \
false \
false \
true \
> data/gold_graphs/$*_deplambda_with_hyperexpand.full.answers.txt
extract_gold_graphs_easyccg:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat working/en-webquestions.train.easyccg.json \
working/en-webquestions.dev.easyccg.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/easyccg_with_merge_with_expand.full \
lib_data/dummy.txt \
true \
true \
> data/gold_graphs/easyccg_with_merge_with_expand.full.answers.txt
extract_gold_graphs_deplambda_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
cat data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json \
data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/$*_deplambda_with_merge_with_expand.full \
lib_data/dummy.txt \
true \
true \
> data/gold_graphs/$*_deplambda_with_merge_with_expand.full.answers.txt
#cat working/$*-webquestions.train.deplambda.json \
# working/$*-webquestions.dev.deplambda.json \
#| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
# data/freebase/schema/all_domains_schema.txt localhost \
# dependency_lambda \
# data/gold_graphs/$*_deplambda_without_merge_with_expand.full \
# lib_data/dummy.txt \
# false \
# true \
> data/gold_graphs/$*_deplambda_without_merge_with_expand.full.answers.txt
#cat working/$*-webquestions.train.deplambda.json \
# working/$*-webquestions.dev.deplambda.json \
#| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
# data/freebase/schema/all_domains_schema.txt localhost \
# dependency_lambda \
# data/gold_graphs/$*_deplambda_with_merge_without_expand.full \
# lib_data/dummy.txt \
# true \
# false \
# > data/gold_graphs/$*_deplambda_with_merge_without_expand.full.answers.txt
#cat working/$*-webquestions.train.deplambda.json \
#working/$*-webquestions.dev.deplambda.json \
#| java -Dfile.encoding="UTF-8" -cp bin:lib/* in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
# data/freebase/schema/all_domains_schema.txt localhost \
# dependency_lambda \
# data/gold_graphs/$*_deplambda_without_merge_without_expand.full \
# lib_data/dummy.txt \
# false \
# false \
# > data/gold_graphs/$*_deplambda_without_merge_without_expand.full.answers.txt
bow_supervised_without_merge_without_expand_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
rm -rf ../working/wq/$*/bow_supervised_without_merge_without_expand
mkdir -p ../working/wq/$*/bow_supervised_without_merge_without_expand
java -Dfile.encoding="UTF-8" -Xms2048m -cp bin:lib/* in.sivareddy.graphparser.cli.RunGraphToQueryTrainingMain \
-pointWiseF1Threshold 0.2 \
-semanticParseKey dependency_lambda \
-schema data/freebase/schema/all_domains_schema.txt \
-relationTypesFile lib_data/dummy.txt \
-lexicon lib_data/dummy.txt \
-domain "http://rdf.freebase.com" \
-typeKey "fb:type.object.type" \
-nthreads 20 \
-trainingSampleSize 2000 \
-iterations 10 \
-nBestTrainSyntacticParses 1 \
-nBestTestSyntacticParses 1 \
-nbestGraphs 100 \
-forestSize 10 \
-ngramLength 2 \
-useSchema true \
-useKB true \
-addBagOfWordsGraph true \
-ngramGrelPartFlag true \
-addOnlyBagOfWordsGraph true \
-groundFreeVariables false \
-groundEntityVariableEdges false \
-groundEntityEntityEdges false \
-useEmptyTypes false \
-ignoreTypes false \
-urelGrelFlag false \
-urelPartGrelPartFlag false \
-utypeGtypeFlag false \
-gtypeGrelFlag false \
-wordGrelPartFlag false \
-wordGrelFlag false \
-eventTypeGrelPartFlag false \
-argGrelPartFlag false \
-argGrelFlag false \
-stemMatchingFlag false \
-mediatorStemGrelPartMatchingFlag false \
-argumentStemMatchingFlag false \
-argumentStemGrelPartMatchingFlag false \
-graphIsConnectedFlag false \
-graphHasEdgeFlag true \
-countNodesFlag false \
-edgeNodeCountFlag false \
-duplicateEdgesFlag true \
-grelGrelFlag true \
-useLexiconWeightsRel false \
-useLexiconWeightsType false \
-validQueryFlag true \
-useGoldRelations true \
-evaluateOnlyTheFirstBest true \
-evaluateBeforeTraining false \
-entityScoreFlag true \
-entityWordOverlapFlag false \
-initialEdgeWeight -0.5 \
-initialTypeWeight -2.0 \
-initialWordWeight -0.05 \
-stemFeaturesWeight 0.05 \
-endpoint localhost \
-goldParsesFile data/gold_graphs/$*_bow_without_merge_without_expand.full.ser \
-contentWordPosTags "NOUN;VERB;ADJ;ADP;ADV;PRON" \
-supervisedCorpus "data/WebQuestions/$(LANG)/$*-webquestions.train.deplambda.json" \
-devFile data/WebQuestions/$(LANG)/$*-webquestions.dev.deplambda.json \
-testFile data/WebQuestions/$(LANG)/$*-webquestions.test.deplambda.json \
-logFile ../working/wq/$*/bow_supervised_without_merge_without_expand/all.log.txt \
> ../working/wq/$*/bow_supervised_without_merge_without_expand/all.txt
bow_supervised_without_merge_without_expand.emb_%:
$(eval LANG := $(shell echo $* | cut -d- -f1))
rm -rf ../working/wq/$*/bow_supervised_without_merge_without_expand.emb
mkdir -p ../working/wq/$*/bow_supervised_without_merge_without_expand.emb
java -Dfile.encoding="UTF-8" -Xms2048m -cp bin:lib/* in.sivareddy.graphparser.cli.RunGraphToQueryTrainingMain \
-pointWiseF1Threshold 0.2 \
-semanticParseKey dependency_lambda \
-schema data/freebase/schema/all_domains_schema.txt \
-relationTypesFile lib_data/dummy.txt \
-embeddingFile data/embeddings/twelve.table4.translation_invariance.window_3+size_40.normalized.de-en-es \
-lexicon lib_data/dummy.txt \
-domain "http://rdf.freebase.com" \
-typeKey "fb:type.object.type" \
-nthreads 20 \
-trainingSampleSize 2000 \
-iterations 10 \
-nBestTrainSyntacticParses 1 \
-nBestTestSyntacticParses 1 \
-nbestGraphs 100 \
-forestSize 10 \
-ngramLength 2 \
-useSchema true \
-useKB true \
-addBagOfWordsGraph true \
-ngramGrelPartFlag true \
-addOnlyBagOfWordsGraph true \
-groundFreeVariables false \
-groundEntityVariableEdges false \
-groundEntityEntityEdges false \
-useEmptyTypes false \
-ignoreTypes false \
-urelGrelFlag false \
-urelPartGrelPartFlag false \
-utypeGtypeFlag false \
-gtypeGrelFlag false \
-wordGrelPartFlag false \
-wordGrelFlag false \
-eventTypeGrelPartFlag false \
-argGrelPartFlag false \
-argGrelFlag false \
-stemMatchingFlag false \