-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
4393 lines (4224 loc) · 185 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
# Extract clueweb sentences
extract_sentences_with_multiple_entities:
python scripts/freebase/extract_clueweb_sentences_containing_entities.py \
../data/clueweb/CLUEWEB09_1/wiki00/ \
../data/clueweb/freebase_annotated_data/ClueWeb09_English_1 \
| gzip > ../data/clueweb/wiki-sentences.json.txt.00.gz
process_clueweb_shard_basic_%:
mkdir -p working/google-annotations/unzipped
tar -xvzf working/google-annotations/$*.tgz -C working/google-annotations/unzipped
python scripts/freebase/extract_clueweb_sentences_containing_entities.py \
working/clueweb/$*/ \
working/google-annotations/unzipped/$* \
| gzip > working/$*-sentences.json.txt.gz
rm -rf working/google-annotations/unzipped/$*
process_clueweb_split_%:
python scripts/freebase/extract_clueweb_sentences_containing_entities.py \
working/clueweb/ClueWeb09_English_1/ \
../data/clueweb/freebase_annotated_data/ClueWeb09_English_1_split$* \
| gzip > ../data/clueweb/ClueWeb09_1-sentences.json.txt.$*.gz
python scripts/freebase/merge_duplicate_sentences.py ../data/clueweb/ClueWeb09_1-sentences.json.txt.$*.gz \
| gzip > ../data/clueweb/ClueWeb09_1-sentences.cleaned.json.txt.$*.gz
zcat ../data0/clueweb/ClueWeb09_1-sentences.cleaned.json.txt.$*.gz \
| java -cp lib/*:bin in.sivareddy.scripts.clueweb.RunTokenizerOnEntityTaggedClueweb \
| python scripts/cleaning/remove_longer_sentences.py \
| python scripts/cleaning/remove_duplicate_sentences.py \
| java -cp lib/*:bin in.sivareddy.scripts.clueweb.RunPosTaggerAndNerWithoutTokenizerPipeline \
| python scripts/run_batch_process.py "java -cp lib/*:bin in.sivareddy.scripts.RunEasyCCG 1" 100000 \
| gzip > ../data0/clueweb/ClueWeb09_1-sentences.cleaned.parsed.json.txt.$*.gz
webq_dev_split:
python scripts/webquestions-preprocessing/training_split.py data/webquestions/webquestions.examples.train.domains.entity.matches.json
extract_easyccg_lexicon_clueweb_split_%:
zcat ../data0/clueweb/ClueWeb09_1-sentences.cleaned.parsed.json.txt.$*.gz \
| python scripts/run_batch_process.py \
"java -cp lib/*:bin in.sivareddy.graphparser.cli.RunPrintDomainLexicon \
-endpoint localhost \
-schema data/freebase/schema/all_domains_schema.txt \
-typeKey "fb:type.object.type" \
-nthreads 40 \
-ignoreTypes true" \
100000 \
| gzip > ../data0/clueweb/ClueWeb09_1-lexicon.txt.$*.gz
extract_wiki_lexicon:
zcat ../data/clueweb/wiki-sentences.cleaned.json.txt.00.gz ../data/clueweb/wiki-sentences.cleaned.json.txt.01.gz ../data/clueweb/wiki-sentences.cleaned.json.txt.02.gz ../data/clueweb/wiki-sentences.cleaned.json.txt.03.gz \
| java -cp lib/*:bin in.sivareddy.scripts.clueweb.RunTokenizerOnEntityTaggedClueweb \
| python scripts/cleaning/remove_longer_sentences.py \
| python scripts/cleaning/remove_duplicate_sentences.py \
| java -cp lib/*:bin in.sivareddy.scripts.clueweb.RunPosTaggerAndNerWithoutTokenizerPipeline \
| python scripts/run_batch_process.py "java -cp lib/*:bin in.sivareddy.scripts.RunEasyCCG 1" 100000 \
| gzip > ../data0/clueweb/ClueWeb09_1-sentences.cleaned.parsed.json.txt.wiki.gz
make extract_easyccg_lexicon_clueweb_split_wiki
merge_easyccg_lexicon:
zcat ../data0/clueweb/ClueWeb09_1-lexicon.txt.1.gz ../data0/clueweb/ClueWeb09_1-lexicon.txt.2.gz ../data0/clueweb/ClueWeb09_1-lexicon.txt.3.gz ../data0/clueweb/ClueWeb09_1-lexicon.txt.wiki.gz \
| python scripts/freebase/merge_lexicon.py \
| gzip > data/complete/grounded_lexicon/easyccg_grounded_lexicon.txt.gz
merge_deplambda_lexicon:
zcat ../data0/clueweb/ClueWeb09_1-lexicon.deplambda.txt.0.gz ../data0/clueweb/ClueWeb09_1-lexicon.deplambda.txt.1.gz ../data0/clueweb/ClueWeb09_1-lexicon.deplambda.txt.2.gz ../data0/clueweb/ClueWeb09_1-lexicon.deplambda.txt.3.gz \
| python scripts/freebase/merge_lexicon.py \
| gzip > data/complete/grounded_lexicon/deplambda_grounded_lexicon.txt.gz
# Merge schema
all_domains_schema:
python scripts/freebase/merge_schema_folder.py data/freebase/schema/all-domains/ > data/freebase/schema/all_domains_schema.txt
# English Automatic Entity Annotation
#
dump_sempre_db:
isql-vt localhost:1111 dba dba < scripts/dump_freebase.isql
create_mid_to_key_dict:
zcat ../data/freebase-cleaned.rdf-2013-08-11-00-00.gz | python scripts/entity-annotation/print_entity_to_id.py | gzip > data/freebase/mid_to_key.txt.gz
convert_sempre_to_standard_db:
zcat /disk/scratch/users/s1051585/tools/var/lib/virtuoso/vdb/data_000001.ttl.gz \
| python scripts/entity-annotation/convert_sempre_freebase_to_standard_freebase.py data/freebase/mid_to_key.txt.gz \
| gzip > /disk/scratch/users/s1051585/data/freebase_sempre.ttl.gz
extract_sempre_entities_list:
zcat /disk/scratch/users/s1051585/data/freebase_sempre.ttl.gz \
| python scripts/entity-annotation/extract_entities_from_standard_sempre.py \
| gzip > data/freebase/freebase_sempre_entities.gz
create_entity_dict:
zcat /disk/scratch/users/s1051585/data/freebase-cleaned.rdf-2013-08-11-00-00.gz | python scripts/entity-annotation/extract_entities_based_on_langcode.py en,en-gb \
| java -cp lib/*:bin in.sivareddy.others.EnglishEntityTokenizer \
| sed -e 's/\-LRB\-/\(/g' \
| sed -e 's/\-RRB\-/\)/g' \
| sed -e 's/\-LSB\-/\[/g' \
| sed -e 's/\-RSB\-/\]/g' \
| gzip > data/freebase/en_entity_lexicon_tokenized.gz
tokenize_entity_dict:
zcat data/freebase/en_entity_lexicon.gz \
| java -cp lib/*:bin in.sivareddy.others.EnglishEntityTokenizer \
| sed -e 's/\-LRB\-/\(/g' \
| sed -e 's/\-RRB\-/\)/g' \
| sed -e 's/\-LSB\-/\[/g' \
| sed -e 's/\-RSB\-/\]/g' \
| gzip \
> data/freebase/en_entity_lexicon_tokenized.gz
entity_span_tag_webq_data:
cat data/webquestions/webquestions.examples.train.domains.json \
| python scripts/entity-annotation/convert_utterance_to_sentence.py \
| python scripts/webquestions-preprocessing/add_gold_mid_using_gold_url.py data/freebase/mid_to_key.txt.gz \
| java -cp lib/*:bin/ in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
| java -cp lib/*:bin in.sivareddy.others.StanfordEnglishPipelineCaseless \
| java -cp lib/*:bin in.sivareddy.scripts.NounPhraseAnnotator EN_PTB \
> data/webquestions/webquestions.examples.train.domains.entity.matches.json
cat data/webquestions/webquestions.examples.test.domains.json \
| python scripts/entity-annotation/convert_utterance_to_sentence.py \
| python scripts/webquestions-preprocessing/add_gold_mid_using_gold_url.py data/freebase/mid_to_key.txt.gz \
| java -cp lib/*:bin/ in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
| java -cp lib/*:bin in.sivareddy.others.StanfordEnglishPipelineCaseless \
| java -cp lib/*:bin in.sivareddy.scripts.NounPhraseAnnotator EN_PTB \
> data/webquestions/webquestions.examples.test.domains.entity.matches.json
free917_print_out_of_domain_relations:
cat data/complete/free917/free917.train.json \
| python scripts/cai-yates-preprocessing/print_json_sentences_from_list.py \
| python scripts/entity-annotation/convert_utterance_to_sentence.py \
| python scripts/cai-yates-preprocessing/rename_targetSparql_to_sparqlQuery.py \
| java -cp lib/*:bin in.sivareddy.scripts.free917.PrintOutOfDomainRelations data/freebase/schema/all_domains_schema.txt \
> working/out_of_domain.txt
cat data/complete/free917/free917.test.json \
| python scripts/cai-yates-preprocessing/print_json_sentences_from_list.py \
| python scripts/entity-annotation/convert_utterance_to_sentence.py \
| python scripts/cai-yates-preprocessing/rename_targetSparql_to_sparqlQuery.py \
| java -cp lib/*:bin in.sivareddy.scripts.free917.PrintOutOfDomainRelations data/freebase/schema/all_domains_schema.txt \
>> working/out_of_domain.txt
free917_merge_out_of_domain_schema:
# First manually create the schema using out_of_domain.txt
python scripts/freebase/merge_schema.py data/freebase/schema/all_domains_schema.txt data/freebase/schema/free917_out_of_domain.txt > data/freebase/schema/all_domains_schema_free917.txt
free917_add_gold_relations_and_process:
cat data/complete/free917/free917.train.json \
| python scripts/cai-yates-preprocessing/print_json_sentences_from_list.py \
| python scripts/entity-annotation/convert_utterance_to_sentence.py \
| python scripts/cai-yates-preprocessing/rename_targetSparql_to_sparqlQuery.py \
| java -cp lib/*:bin in.sivareddy.scripts.free917.AddGoldRelationsAndMidToFree917Data data/freebase/schema/all_domains_schema_free917.txt \
| java -cp lib/*:bin in.sivareddy.others.StanfordEnglishPipelineCaseless \
| python scripts/cai-yates-preprocessing/add_question_word.py \
> data/complete/free917/free917.train.tokenized.json
cat data/complete/free917/free917.test.json \
| python scripts/cai-yates-preprocessing/print_json_sentences_from_list.py \
| python scripts/entity-annotation/convert_utterance_to_sentence.py \
| python scripts/cai-yates-preprocessing/rename_targetSparql_to_sparqlQuery.py \
| java -cp lib/*:bin in.sivareddy.scripts.free917.AddGoldRelationsAndMidToFree917Data data/freebase/schema/all_domains_schema_free917.txt \
| java -cp lib/*:bin in.sivareddy.others.StanfordEnglishPipelineCaseless \
| python scripts/cai-yates-preprocessing/add_question_word.py \
> data/complete/free917/free917.test.tokenized.json
free917_split_data:
python scripts/cai-yates-preprocessing/training_split.py data/complete/free917/free917.train.tokenized.json
mv data/complete/free917/free917.train.tokenized.json.70 data/complete/free917/free917.train.split.tokenized.json
mv data/complete/free917/free917.train.tokenized.json.30 data/complete/free917/free917.dev.split.tokenized.json
free917_tag_entities_using_manual_lexicon:
python scripts/cai-yates-preprocessing/convert_named_enttiy_lexicon_to_gp_entity_lexicon_format.py \
< data/complete/free917/free917_entities.txt \
> data/complete/free917/free917_entities_gp_format.txt
cat data/complete/free917/free917_entities_gp_format.txt \
| java -cp lib/*:bin in.sivareddy.others.EnglishEntityTokenizer \
| sed -e 's/\-LRB\-/\(/g' \
| sed -e 's/\-RRB\-/\)/g' \
| sed -e 's/\-LSB\-/\[/g' \
| sed -e 's/\-RSB\-/\]/g' \
| sed -e 's/m.0csy8\t/m.02217f\t/g' \
> data/complete/free917/free917_entities_gp_format_tokenized.txt
java -cp lib/*:bin in.sivareddy.scripts.free917.EntityAnnotateFree917 data/complete/free917/free917_entities_gp_format_tokenized.txt \
< data/complete/free917/free917.train.split.tokenized.json \
> data/complete/free917/free917.train.tokenized.disambiguatedEntities.json
cat data/complete/free917/free917.train.tokenized.disambiguatedEntities.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences \
> data/complete/vanilla_gold/free917.train.easyccg.json
java -cp lib/*:bin in.sivareddy.scripts.free917.EntityAnnotateFree917 data/complete/free917/free917_entities_gp_format_tokenized.txt \
< data/complete/free917/free917.dev.split.tokenized.json \
> data/complete/free917/free917.dev.tokenized.disambiguatedEntities.json
cat data/complete/free917/free917.dev.tokenized.disambiguatedEntities.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences \
> data/complete/vanilla_gold/free917.dev.easyccg.json
java -cp lib/*:bin in.sivareddy.scripts.free917.EntityAnnotateFree917 data/complete/free917/free917_entities_gp_format_tokenized.txt \
< data/complete/free917/free917.test.tokenized.json \
> data/complete/free917/free917.test.tokenized.disambiguatedEntities.json
cat data/complete/free917/free917.test.tokenized.disambiguatedEntities.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences \
> data/complete/vanilla_gold/free917.test.easyccg.json
add_gold_relations:
cat data/webquestions/webquestions.examples.train.domains.entity.matches.json \
| java -cp lib/*:bin/ in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
> working/webquestions.examples.train.domains.entity.matches.json
mv working/webquestions.examples.train.domains.entity.matches.json data/webquestions/webquestions.examples.train.domains.entity.matches.json
cat data/webquestions/webquestions.examples.test.domains.entity.matches.json \
| java -cp lib/*:bin/ in.sivareddy.scripts.AddGoldRelationsToWebQuestionsData localhost data/freebase/schema/all_domains_schema.txt \
> working/webquestions.examples.test.domains.entity.matches.json
mv working/webquestions.examples.test.domains.entity.matches.json data/webquestions/webquestions.examples.test.domains.entity.matches.json
rank_entity_webq_data:
cat data/webquestions/webquestions.examples.train.domains.entity.matches.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.RankMatchedEntities \
> data/webquestions/webquestions.examples.train.domains.entity.matches.ranked.json
cat data/webquestions/webquestions.examples.test.domains.entity.matches.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.RankMatchedEntities \
> data/webquestions/webquestions.examples.test.domains.entity.matches.ranked.json
noun_phrase_annotator:
cat data/complete/free917/free917.train.tokenized.json
| java -cp lib/*:bin in.sivareddy.scripts.NounPhraseAnnotator EN_PTB \
> data/complete/free917/free917.train.entity.matches.json
cat data/complete/free917/free917.test.tokzenized.json
| java -cp lib/*:bin in.sivareddy.scripts.NounPhraseAnnotator EN_PTB \
> data/complete/free917/free917.test.entity.matches.json
rank_entity_free917_data:
cat data/complete/free917/free917.train.entity.matches.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.RankMatchedEntities \
> data/complete/free917/free917.train.entity.matches.ranked.json
cat data/complete/free917/free917.test.entity.matches.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.RankMatchedEntities \
> data/complete/free917/free917.test.entity.matches.ranked.json
disambiguate_entities_webq_data:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-inputFile data/webquestions/webquestions.examples.train.domains.entity.matches.ranked.json \
-outputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-inputFile data/webquestions/webquestions.examples.test.domains.entity.matches.ranked.json \
-outputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.json
disambiguate_entities_free917_data:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema_free917.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-inputFile data/complete/free917/free917.train.entity.matches.ranked.json \
-outputFile data/complete/free917/free917.train.entity.disambiguated.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema_free917.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-inputFile data/complete/free917/free917.test.entity.matches.ranked.json \
-outputFile data/complete/free917/free917.test.entity.disambiguated.json
disambiguate_entities_webq_data_second_pass:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-inputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.json \
-outputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.2.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-inputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.json \
-outputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.2.json
disambiguate_entities_free917_data_second_pass:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema_free917.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-inputFile data/complete/free917/free917.train.entity.disambiguated.json \
-outputFile data/complete/free917/free917.train.entity.disambiguated.2.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema_free917.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-inputFile data/complete/free917/free917.test.entity.disambiguated.json \
-outputFile data/complete/free917/free917.test.entity.disambiguated.2.json
disambiguate_entities_webq_data_third_pass:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity true \
-inputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.2.json \
-outputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity true \
-inputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.2.json \
-outputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json
disambiguate_entities_free917_data_third_pass:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema_free917.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity true \
-inputFile data/complete/free917/free917.train.entity.disambiguated.2.json \
-outputFile data/complete/free917/free917.train.entity.disambiguated.3.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema_free917.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity true \
-inputFile data/complete/free917/free917.test.entity.disambiguated.2.json \
-outputFile data/complete/free917/free917.test.entity.disambiguated.3.json
disambiguate_entities_free917_data_fourth_pass:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity false \
-inputFile data/complete/free917/free917.train.entity.disambiguated.3.json \
-outputFile data/complete/free917/free917.train.entity.disambiguated.4.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity false \
-inputFile data/complete/free917/free917.test.entity.disambiguated.3.json \
-outputFile data/complete/free917/free917.test.entity.disambiguated.4.json
replace_unknown_mids:
cat data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin/ in.sivareddy.scripts.MapNewMidToOldMid data/freebase/entities_sempre.txt.gz data/freebase/mid_to_key.txt.gz data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
> working/train.txt
mv working/train.txt data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json
cat data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin/ in.sivareddy.scripts.MapNewMidToOldMid data/freebase/entities_sempre.txt.gz data/freebase/mid_to_key.txt.gz data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
> working/test.txt
mv working/test.txt data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json
replace_unknown_mids_free917:
cat data/complete/free917/free917.train.entity.disambiguated.3.json \
| java -cp lib/*:bin/ in.sivareddy.scripts.MapNewMidToOldMid data/freebase/entities_sempre.txt.gz data/freebase/mid_to_key.txt.gz \
> working/train.free917.txt
mv working/train.free917.txt data/complete/free917/free917.train.entity.disambiguated.3.json
cat data/complete/free917/free917.test.entity.disambiguated.3.json \
| java -cp lib/*:bin/ in.sivareddy.scripts.MapNewMidToOldMid data/freebase/entities_sempre.txt.gz data/freebase/mid_to_key.txt.gz \
> working/test.free917.txt
mv working/test.free917.txt data/complete/free917/free917.test.entity.disambiguated.3.json
entity_disambiguation_results:
python scripts/entity-annotation/evaluate_entity_annotation.py < data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json | less
entity_disambiguation_results_free917:
python scripts/entity-annotation/evaluate_entity_annotation.py < data/complete/free917/free917.train.entity.disambiguated.3.json | less
copy_gold_relations:
python scripts/entity-annotation/copy_gold_relations.py data/webquestions/webquestions.examples.train.domains.entity.matches.json \
< data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json \
> working/webquestions.examples.train.domains.entity.disambiguated.3.json
mv working/webquestions.examples.train.domains.entity.disambiguated.3.json data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json
python scripts/entity-annotation/copy_gold_relations.py data/webquestions/webquestions.examples.test.domains.entity.matches.json \
< data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
> working/webquestions.examples.test.domains.entity.disambiguated.3.json
mv working/webquestions.examples.test.domains.entity.disambiguated.3.json data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json
disambiguate_entities_webq_data_fourth_pass:
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity false \
-inputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json \
-outputFile data/webquestions/webquestions.examples.train.domains.entity.disambiguated.4.json
java -cp lib/*:bin in.sivareddy.graphparser.cli.RunDisambiguateEntities \
-endpoint localhost \
-typeKey "fb:type.object.type" \
-schema data/freebase/schema/all_domains_schema.txt \
-initialNbest 10 \
-intermediateNbest 10 \
-finalNbest 10 \
-entityHasReadableId true \
-nthreads 10 \
-noSucceedingNamedEntity false \
-noPrecedingNamedEntity false \
-containsNamedEntity false \
-shouldStartWithNamedEntity false \
-inputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
-outputFile data/webquestions/webquestions.examples.test.domains.entity.disambiguated.4.json
entity_dismabiguated_webq_to_graphparser_forrest:
cat data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences \
> working/webquestions.train.full.pass3.txt
cat working/webquestions.train.full.pass3.txt \
| python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.30 \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt
cat working/webquestions.train.full.pass3.txt \
| python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.70 \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.json.txt
cat data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences \
> working/webquestions.test.full.pass3.txt
cat working/webquestions.test.full.pass3.txt \
| python scripts/extract_subset.py data/complete/vanilla_gold/webquestions.vanilla.test.full.easyccg.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.test.pass3.json.txt
entity_dismabiguated_webq_to_graphparser_forrest_easysrl:
cat data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences easysrl \
> working/webquestions.train.easysrl.full.pass3.txt
cat working/webquestions.train.easysrl.full.pass3.txt \
| python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.30 \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.easysrl.pass3.json.txt
cat working/webquestions.train.easysrl.full.pass3.txt \
| python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.70 \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.easysrl.pass3.json.txt
cat data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin in.sivareddy.scripts.CreateGraphParserForrestFromEntityDisambiguatedSentences easysrl \
> working/webquestions.test.easysrl.full.pass3.txt
cat working/webquestions.test.easysrl.full.pass3.txt \
| python scripts/extract_subset.py data/complete/vanilla_gold/webquestions.vanilla.test.full.easyccg.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.test.easysrl.pass3.json.txt
split_forest_to_sentences:
cat data/webquestions/webquestions.examples.train.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.SplitForrestToSentences \
|java -cp lib/*:bin in.sivareddy.graphparser.util.MergeEntity \
> working/webquestions.automaticDismabiguation.train.pass3.json.txt
cat data/webquestions/webquestions.examples.test.domains.entity.disambiguated.3.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.SplitForrestToSentences \
|java -cp lib/*:bin in.sivareddy.graphparser.util.MergeEntity \
> working/webquestions.automaticDismabiguation.test.pass3.json.txt
free917_split_forest_to_sentences:
cat data/complete/free917/free917.train.tokenized.disambiguatedEntities.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.SplitForrestToSentences \
|java -cp lib/*:bin in.sivareddy.graphparser.util.MergeEntity false \
> working/free917.train.forest_split.json
cat data/complete/free917/free917.dev.tokenized.disambiguatedEntities.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.SplitForrestToSentences \
|java -cp lib/*:bin in.sivareddy.graphparser.util.MergeEntity false \
> working/free917.dev.forest_split.json
cat data/complete/free917/free917.test.tokenized.disambiguatedEntities.json \
| java -cp lib/*:bin in.sivareddy.graphparser.util.SplitForrestToSentences \
|java -cp lib/*:bin in.sivareddy.graphparser.util.MergeEntity false \
> working/free917.test.forest_split.json
full_data_to_xukun:
cat working/webquestions.automaticDismabiguation.train.pass3.json.txt | python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.30 > working/dev.txt
cat working/webquestions.automaticDismabiguation.train.pass3.json.txt | python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.70 > working/training.txt
cat working/webquestions.automaticDismabiguation.test.pass3.json.txt | python scripts/extract_subset.py ../FreePar/data/webquestions/webquestions.test.all.entity_annotated.vanilla.txt > working/test.txt
webq_to_oscar:
cat working/webquestions.automaticDismabiguation.train.pass3.json.txt | python scripts/extract_subset.py data/complete/vanilla_gold/webquestions.vanilla.dev.full.easyccg.json.txt > working/dev.txt
cat working/dev.txt | python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py > working/webquestions.vanilla.freebaseAPIannotations.dev.split.json.txt
cat working/webquestions.automaticDismabiguation.train.pass3.json.txt | python scripts/extract_subset.py data/complete/vanilla_gold/webquestions.vanilla.train.full.easyccg.json.txt > working/training.txt
cat working/training.txt | python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py > working/webquestions.vanilla.freebaseAPIannotations.train.split.json.txt
cat working/webquestions.automaticDismabiguation.test.pass3.json.txt | python scripts/extract_subset.py data/webquestions/webquestions.examples.test.domains.entity.matches.json > working/test.txt
cat working/test.txt | python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py > working/webquestions.vanilla.freebaseAPIannotations.test.split.json.txt
free917_to_oscar:
cat working/free917.train.forest_split.json \
| python scripts/cai-yates-preprocessing/add_answers.py data/complete/free917/free917.answers.txt \
| python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py \
> working/free917.train.gold_entities.json.txt
cat working/free917.dev.forest_split.json \
| python scripts/cai-yates-preprocessing/add_answers.py data/complete/free917/free917.answers.txt \
| python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py \
> working/free917.dev.gold_entities.json.txt
cat working/free917.test.forest_split.json \
| python scripts/cai-yates-preprocessing/add_answers.py data/complete/free917/free917.answers.txt \
| python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py \
> working/free917.test.gold_entities.json.txt
clueweb_to_deplamba_%:
zcat ../data0/clueweb/ClueWeb09_1-sentences.cleaned.parsed.json.txt.$*.gz \
| python scripts/cleaning/filter_sentences_with_no_parses.py \
| python scripts/convert-graph-parser-to-entity-mention-format_with_answers.py \
| gzip > working/ClueWeb09_1-sentences.$*.gz
convert_deplambda_clueweb_to_gp_forest:
zcat working/clueweb-1shard-lambdas.json.txt.gz \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| python scripts/dependency_semantic_parser/remove_spurious_predicates.py \
| python scripts/dependency_semantic_parser/collapse_copula_relation.py \
| gzip > data/complete/clueweb/clueweb_deplambda_singletype.txt.gz
zcat data/complete/clueweb/clueweb_deplambda_singletype.txt.gz | python scripts/split_file.py 14740240 4 ../data0/clueweb/clueweb_deplambda_singletype
gzip ../data0/clueweb/clueweb_deplambda_singletype.0
gzip ../data0/clueweb/clueweb_deplambda_singletype.1
gzip ../data0/clueweb/clueweb_deplambda_singletype.2
gzip ../data0/clueweb/clueweb_deplambda_singletype.3
extract_deplambda_lexicon_clueweb_split_%:
zcat ../data0/clueweb/clueweb_deplambda_singletype.$*.gz \
| python scripts/run_batch_process.py \
"java -cp lib/*:bin in.sivareddy.graphparser.cli.RunPrintDomainLexicon \
-endpoint localhost \
-schema data/freebase/schema/all_domains_schema.txt \
-semanticParseKey dependency_lambda \
-typeKey "fb:type.object.type" \
-nthreads 40 \
-ignoreTypes true" \
100000 \
| gzip > ../data0/clueweb/ClueWeb09_1-lexicon.deplambda.txt.$*.gz
convert_deplambda_to_gp_forest:
cat working/wq-train-lambdas.json.txt working/wq-dev-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| python scripts/dependency_semantic_parser/remove_spurious_predicates.py \
| python scripts/dependency_semantic_parser/collapse_copula_relation.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/webquestions.automaticDismabiguation.train.pass3.json.txt \
> working/webquestions-train-full-lambdas.json.txt
python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.30 \
< working/webquestions-train-full-lambdas.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt
python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.70 \
< working/webquestions-train-full-lambdas.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt
cat working/wq-test-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| python scripts/dependency_semantic_parser/remove_spurious_predicates.py \
| python scripts/dependency_semantic_parser/collapse_copula_relation.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/webquestions.automaticDismabiguation.test.pass3.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.test.pass3.deplambda.singletype.json.txt
convert_deplambda_to_gp_forest_with_coupla:
cat working/wq-train-lambdas.json.txt working/wq-dev-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/webquestions.automaticDismabiguation.train.pass3.json.txt \
> working/webquestions-train-full-lambdas.json.txt
python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.30 \
< working/webquestions-train-full-lambdas.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.with_copula.dev.pass3.deplambda.singletype.json.txt
python scripts/extract_subset.py data/webquestions/webquestions.examples.train.domains.entity.matches.json.70 \
< working/webquestions-train-full-lambdas.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.with_copula.train.pass3.deplambda.singletype.json.txt
cat working/wq-test-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/webquestions.automaticDismabiguation.test.pass3.json.txt \
> data/complete/vanilla_automatic/webquestions.automaticDismabiguation.with_copula.test.pass3.deplambda.singletype.json.txt
free917_convert_deplambda_to_gp_forest:
cat working/free917-dev-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| python scripts/dependency_semantic_parser/remove_spurious_predicates.py \
| python scripts/dependency_semantic_parser/collapse_copula_relation.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/free917.dev.forest_split.json \
> data/complete/vanilla_gold/free917.dev.deplambda.singletype.json
cat working/free917-train-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| python scripts/dependency_semantic_parser/remove_spurious_predicates.py \
| python scripts/dependency_semantic_parser/collapse_copula_relation.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/free917.train.forest_split.json \
> data/complete/vanilla_gold/free917.train.deplambda.singletype.json
cat working/free917-test-lambdas.json.txt \
| python scripts/dependency_semantic_parser/convert_document_json_graphparser_json_new.py \
| python scripts/dependency_semantic_parser/remove_spurious_predicates.py \
| python scripts/dependency_semantic_parser/collapse_copula_relation.py \
| java -cp lib/*:bin in.sivareddy.scripts.MergeSplitsToForest working/free917.test.forest_split.json \
> data/complete/vanilla_gold/free917.test.deplambda.singletype.json
data_to_xukun:
cat working/webquestions.automaticDismabiguation.test.pass3.json.txt \
| python scripts/extract_subset.py data/tacl/vanilla_one_best/webquestions.examples.test.domains.entity.matches.ranked.1best.merged.tacl.json \
> working/webquestions.automaticDismabiguation.test.pass3.taclSubset.json.txt
cat working/webquestions.automaticDismabiguation.train.pass3.json.txt \
| python scripts/extract_subset.py data/tacl/vanilla_one_best/webquestions.examples.train.domains.entity.matches.ranked.1best.merged.tacl.json.915 \
> working/webquestions.automaticDismabiguation.train.pass3.taclSubset.json.txt
cat working/webquestions.automaticDismabiguation.train.pass3.json.txt \
| python scripts/extract_subset.py data/tacl/vanilla_one_best/webquestions.examples.train.domains.entity.matches.ranked.1best.merged.tacl.json.200 \
> working/webquestions.automaticDismabiguation.dev.pass3.taclSubset.json.txt
# Spanish Experiments
# Tokenize Entities
tokenize_spanish_entities:
zcat data/freebase/spanish/spanish_business_entities.txt.gz | java -cp lib/*:bin in.sivareddy.others.SpanishEntityTokenizer | gzip > data/freebase/spanish/spanish_business_entities.tokenized.txt.gz
zcat data/freebase/spanish/spanish_film_entities.txt.gz | java -cp lib/*:bin in.sivareddy.others.SpanishEntityTokenizer | gzip > data/freebase/spanish/spanish_film_entities.tokenized.txt.gz
zcat data/freebase/spanish/spanish_people_entities.txt.gz | java -cp lib/*:bin in.sivareddy.others.SpanishEntityTokenizer | gzip > data/freebase/spanish/spanish_people_entities.tokenized.txt.gz
zcat data/freebase/spanish/spanish_business_entities.tokenized.txt.gz data/freebase/spanish/spanish_film_entities.tokenized.txt.gz data/freebase/spanish/spanish_people_entities.tokenized.txt.gz | gzip > data/freebase/spanish/spanish_business_film_people_entities.tokenized.txt.gz
extract_spanish_sentences:
bzcat data/bravas/extracted/AA/wiki_00.bz2 \
| java -cp lib/*:bin in.sivareddy.others.SpanishTokenizer \
| perl -pe 's|=LRB=.*?=RRB=||g' \
| grep -v =LRB= | grep -v =RRB= \
| python scripts/spanish/select_sentences_with_entities_in_relation.py data/freebase/spanish/spanish_business_film_people_entities.tokenized.txt.gz data/freebase/domain_facts/business_film_people_facts.txt.gz data/freebase/schema/business_film_people_schema.txt \
| python scripts/spanish/select_sentences_with_non_adjacent_main_relation.py data/freebase/domain_facts/business_film_people_facts.txt.gz data/freebase/schema/business_film_people_schema.txt \
| java -cp lib/*:bin in.sivareddy.others.SpanishPosAndNer \
| python scripts/spanish/process_named_entities.py \
| gzip > data/freebase/spanish/spanish_wikipedia_business_film_people_sentences.json.txt.gz
create_spanish_deplambda_format:
zcat data/freebase/spanish/spanish_wikipedia_business_film_people_sentences.json.txt.gz \
| python scripts/spanish/create-entity-mention-format.py \
| gzip \
> ../working/spanish_wikipedia.txt.gz
# Spanish WebQuestions Processing
entity_tag_spanish:
python scripts/spanish/combine_wq_entities_spanish_english.py data/spanish_webquestions/webquestions.lexicon.txt data/freebase/spanish/spanish_business_film_people_entities.tokenized.txt.gz > data/spanish_webquestions/webquestions.lexicon.extended.txt
cat data/spanish_webquestions/webquestions.examples.test.utterances_es \
| java -cp lib/*:bin in.sivareddy.others.SpanishTokenizerEol \
| python scripts/spanish/annotate_entities_maximal_string_matching.py data/spanish_webquestions/webquestions.lexicon.extended.txt \
| python scripts/spanish/add_sentences.py data/spanish_webquestions/webquestions.examples.test.utterances data/spanish_webquestions/webquestions.examples.test.utterances_es \
| python scripts/spanish/merge_english_annotations.py data/webquestions/webquestions.examples.test.domains.json \
| java -cp lib/*:bin in.sivareddy.others.SpanishPosAndNer \
| python scripts/spanish/process_named_entities.py \
> data/spanish_webquestions/webquestions.examples.test.es.json
cat data/spanish_webquestions/webquestions.examples.train.utterances_es \
| java -cp lib/*:bin in.sivareddy.others.SpanishTokenizerEol \
| python scripts/spanish/annotate_entities_maximal_string_matching.py data/spanish_webquestions/webquestions.lexicon.extended.txt \
| python scripts/spanish/add_sentences.py data/spanish_webquestions/webquestions.examples.train.utterances data/spanish_webquestions/webquestions.examples.train.utterances_es \
| python scripts/spanish/merge_english_annotations.py data/webquestions/webquestions.examples.train.domains.json \
| java -cp lib/*:bin in.sivareddy.others.SpanishPosAndNer \
| python scripts/spanish/process_named_entities.py \
> data/spanish_webquestions/webquestions.examples.train.es.json
create_spanish_splits:
python scripts/spanish/select_splits_from_english.py data/spanish_webquestions/webquestions.examples.train.es.json data/tacl/webquestions.examples.train.domains.easyccg.parse.filtered.json.train.915 > data/spanish_webquestions/webquestions.examples.business_film_people.train.json.txt
python scripts/spanish/select_splits_from_english.py data/spanish_webquestions/webquestions.examples.train.es.json data/tacl/webquestions.examples.train.domains.easyccg.parse.filtered.json.dev.200 > data/spanish_webquestions/webquestions.examples.business_film_people.dev.json.txt
python scripts/spanish/select_splits_from_english.py data/spanish_webquestions/webquestions.examples.test.es.json data/tacl/webquestions.examples.test.domains.easyccg.parse.filtered.json > data/spanish_webquestions/webquestions.examples.business_film_people.test.json.txt
cat data/spanish_webquestions/webquestions.examples.business_film_people.train.json.txt \
| python scripts/spanish/create-entity-mention-format.py \
> working/webquestions.es.examples.business_film_people.train.json.txt
cat data/spanish_webquestions/webquestions.examples.business_film_people.dev.json.txt \
| python scripts/spanish/create-entity-mention-format.py \
> working/webquestions.es.examples.business_film_people.dev.json.txt
cat data/spanish_webquestions/webquestions.examples.business_film_people.test.json.txt \
| python scripts/spanish/create-entity-mention-format.py \
> working/webquestions.es.examples.business_film_people.test.json.txt
create_old_to_new_mid_mappings:
zcat kinloch:/gpfs/scratch/users/s1051585/freebase/freebase-20150720.gz | grep dataworld.gardening_hint.replaced_by | cut -f1,3 | python scripts/freebase/clean_old_mid_to_mid.py | gzip > data/freebase/freebase_20150720_old_to_new_mid.txt.gz
zcat kinloch:/disk/scratch/users/s1051585/data/freebase-cleaned.rdf-2013-08-11-00-00.gz | grep dataworld.gardening_hint.replaced_by | cut -f1,3 | python scripts/freebase/clean_old_mid_to_mid.py | gzip > data/freebase/freebase_20130811_old_to_new_mid.txt.gz
zcat ../data/freebase_sempre.ttl.gz | cut -f1,3 | python scripts/freebase/extract_entities_from_rdf_freebase.py | less
### WebQuestions complete data experiments ###
extract_gold_graphs_deplambda_singletype_dev:
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_with_merge_with_expand.dev \
lib_data/dummy.txt \
true \
true \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
> data/gold_graphs/deplambda_singletype_with_merge_with_expand.dev.answers.txt
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_without_merge_with_expand.dev \
lib_data/dummy.txt \
false \
true \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
> data/gold_graphs/deplambda_singletype_without_merge_with_expand.dev.answers.txt
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_with_merge_without_expand.dev \
lib_data/dummy.txt \
true \
false \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
> data/gold_graphs/deplambda_singletype_with_merge_without_expand.dev.answers.txt
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_without_merge_without_expand.dev \
lib_data/dummy.txt \
false \
false \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
> data/gold_graphs/deplambda_singletype_without_merge_without_expand.dev.answers.txt
extract_gold_graphs_deplambda_singletype:
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_with_merge_with_expand.full \
lib_data/dummy.txt \
true \
true \
> data/gold_graphs/deplambda_singletype_with_merge_with_expand.full.answers.txt
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_without_merge_with_expand.full \
lib_data/dummy.txt \
false \
true \
> data/gold_graphs/deplambda_singletype_without_merge_with_expand.full.answers.txt
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_with_merge_without_expand.full \
lib_data/dummy.txt \
true \
false \
> data/gold_graphs/deplambda_singletype_with_merge_without_expand.full.answers.txt
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_without_merge_without_expand.full \
lib_data/dummy.txt \
false \
false \
> data/gold_graphs/deplambda_singletype_without_merge_without_expand.full.answers.txt
extract_gold_graphs_deplambda_singletype_with_lexicon:
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
dependency_lambda \
data/gold_graphs/deplambda_singletype_with_merge_with_expand_with_lexicon.full \
data/complete/grounded_lexicon/deplambda_grounded_lexicon.txt.gz \
true \
true \
> data/gold_graphs/deplambda_singletype_with_merge_with_expand_with_lexicon.full.answers.txt
extract_gold_graphs_dependency_dev:
java -cp lib/*:bin/ 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/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
> data/gold_graphs/dependency_without_merge_without_expand.dev.answers.txt
java -cp lib/*:bin/ 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/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
> data/gold_graphs/dependency_with_merge_without_expand.dev.answers.txt
extract_gold_graphs_dependency:
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ 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/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.deplambda.singletype.json.txt data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.deplambda.singletype.json.txt \
| java -cp lib/*:bin/ 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_ccg_dev:
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_with_merge_without_expand.dev \
lib_data/dummy.txt \
true \
false \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
> data/gold_graphs/ccg_with_merge_without_expand.dev.answers.txt
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_with_merge_with_expand.dev \
lib_data/dummy.txt \
true \
true \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
> data/gold_graphs/ccg_with_merge_with_expand.dev.answers.txt
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_without_merge_with_expand.dev \
lib_data/dummy.txt \
false \
true \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
> data/gold_graphs/ccg_without_merge_with_expand.dev.answers.txt
java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_without_merge_without_expand.dev \
lib_data/dummy.txt \
false \
false \
< data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
> data/gold_graphs/ccg_without_merge_without_expand.dev.answers.txt
extract_gold_graphs_ccg:
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.json.txt \
data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_with_merge_without_expand.full \
lib_data/dummy.txt \
true \
false \
> data/gold_graphs/ccg_with_merge_without_expand.full.answers.txt
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.json.txt \
data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_with_merge_with_expand.full \
lib_data/dummy.txt \
true \
true \
> data/gold_graphs/ccg_with_merge_with_expand.full.answers.txt
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.json.txt \
data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_without_merge_without_expand.full \
lib_data/dummy.txt \
false \
false \
> data/gold_graphs/ccg_without_merge_without_expand.full.answers.txt
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.json.txt \
data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_without_merge_with_expand.full \
lib_data/dummy.txt \
false \
true \
> data/gold_graphs/ccg_without_merge_with_expand.full.answers.txt
extract_gold_graphs_ccg_with_lexicon:
cat data/complete/vanilla_automatic/webquestions.automaticDismabiguation.train.pass3.json.txt \
data/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
| java -cp lib/*:bin/ in.sivareddy.scripts.EvaluateGraphParserOracleUsingGoldMidAndGoldRelations \
data/freebase/schema/all_domains_schema.txt localhost \
synPars \
data/gold_graphs/ccg_with_merge_with_expand_with_lexicon.full \
data/complete/grounded_lexicon/easyccg_grounded_lexicon.txt.gz \
true \
true \
> data/gold_graphs/ccg_with_merge_with_expand_with_lexicon.full.answers.txt
extract_gold_graphs_bow_dev:
java -cp lib/*:bin/ 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/complete/vanilla_automatic/webquestions.automaticDismabiguation.dev.pass3.json.txt \
> data/gold_graphs/bow_without_merge_without_expand.dev.answers.txt
java -cp lib/*:bin/ 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 \