-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile.uw
322 lines (312 loc) · 11.9 KB
/
Makefile.uw
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
process_gq:
python scripts/graphquestions/convert_to_graph_parser_format.py \
< data/GraphQuestions/freebase13/graphquestions.training.json data/freebase/mid_to_key.txt.gz \
> data/GraphQuestions/freebase13/graphquestions.training.mid.json
python scripts/graphquestions/convert_to_graph_parser_format.py \
< data/GraphQuestions/freebase13/graphquestions.testing.json data/freebase/mid_to_key.txt.gz \
> data/GraphQuestions/freebase13/graphquestions.testing.mid.json
annotate_entity_spans:
cat data/GraphQuestions/freebase13/graphquestions.training.mid.json \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos,lemma \
ssplit.newlineIsSentenceBreak always \
languageCode en \
pos.model lib_data/ud-models-v1.3/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.tagger \
| java -cp bin:lib/* in.sivareddy.scripts.NounPhraseAnnotator en_ud \
> working/graphquestions.training.mid.json
cat data/GraphQuestions/freebase13/graphquestions.testing.mid.json \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos,lemma \
ssplit.newlineIsSentenceBreak always \
languageCode en \
pos.model lib_data/ud-models-v1.3/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.tagger \
| java -cp bin:lib/* in.sivareddy.scripts.NounPhraseAnnotator en_ud \
> working/graphquestions.testing.mid.json
entity_annotate:
# Entity Annotations
cat working/graphquestions.training.mid.json \
| java -cp bin:lib/* in.sivareddy.graphparser.cli.RankMatchedEntitiesCli \
--useKG true \
--apiKey AIzaSyDj-4Sr5TmDuEA8UVOd_89PqK87GABeoFg \
--langCode en \
> working/graphquestions.training.mid.ranked.json
cat working/graphquestions.testing.mid.json \
| java -cp bin:lib/* in.sivareddy.graphparser.cli.RankMatchedEntitiesCli \
--useKG true \
--apiKey AIzaSyDj-4Sr5TmDuEA8UVOd_89PqK87GABeoFg \
--langCode en \
> working/graphquestions.testing.mid.ranked.json
evaluate_entity_annotation_upperbound:
cat working/graphquestions.training.mid.ranked.json \
| python scripts/entity-annotation/get_entity_patterns.py
train_entity_annotator:
mkdir -p data/entity-models
java -cp bin:lib/* in.sivareddy.graphparser.cli.RunTrainEntityScorer \
-nthreads 20 \
-iterations 100 \
-hasId false \
-trainFile working/graphquestions.training.mid.ranked.json \
-devFile working/graphquestions.testing.mid.ranked.json \
-saveToFile data/entity-models/graph-questions.ser
disambiguate_entities:
cat working/graphquestions.training.mid.ranked.json \
| java -cp bin:lib/* in.sivareddy.graphparser.cli.RunEntityDisambiguator \
-loadModelFromFile data/entity-models/graph-questions.ser \
-endpoint localhost \
-nthreads 20 \
-nbestEntities 10 \
-hasId false \
-schema data/freebase/schema/all_domains_schema.txt \
> working/graphquestions.training.mid.disambiguated.json
cat working/graphquestions.testing.mid.ranked.json \
| java -cp bin:lib/* in.sivareddy.graphparser.cli.RunEntityDisambiguator \
-loadModelFromFile data/entity-models/graph-questions.ser \
-endpoint localhost \
-nthreads 20 \
-nbestEntities 10 \
-hasId false \
-schema data/freebase/schema/all_domains_schema.txt \
> working/graphquestions.testing.mid.disambiguated.json
entity_dismabiguated_to_plain_forest:
cat working/graphquestions.training.mid.disambiguated.json \
| java -cp bin:lib/* in.sivareddy.graphparser.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos,lemma \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.3/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.tagger \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
preprocess.addDateEntities true \
preprocess.mergeEntityWords true \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
postprocess.correctPosTags true \
> working/graphquestions.training.plain.forest.json
cat working/graphquestions.testing.mid.disambiguated.json \
| java -cp bin:lib/* in.sivareddy.graphparser.util.CreateGraphParserForestFromEntityDisambiguatedSentences \
preprocess.lowerCase true \
annotators tokenize,ssplit,pos,lemma \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.3/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.tagger \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
preprocess.addDateEntities true \
preprocess.mergeEntityWords true \
annotators tokenize,ssplit \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
postprocess.correctPosTags true \
> working/graphquestions.testing.plain.forest.json
gq_ccg_parse:
cat working/graphquestions.training.plain.forest.json \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
preprocess.capitalizeUsingPosTags true \
preprocess.capitalizeFirstWord true \
ccgParser easyccg \
ccgParser.modelFolder lib_data/easyccg_model_questions \
ccgParser.parserArguments -s,-r,S[q],S[qem],S[wq] \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
ccgParser easyccg \
ccgParser.modelFolder lib_data/easyccg_model \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.3/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.tagger \
postprocess.correctPosTags true \
> working/graphquestions.training.easyccg.forest.json
cat working/graphquestions.testing.plain.forest.json \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
preprocess.capitalizeUsingPosTags true \
preprocess.capitalizeFirstWord true \
ccgParser easyccg \
ccgParser.modelFolder lib_data/easyccg_model_questions \
ccgParser.parserArguments -s,-r,S[q],S[qem],S[wq] \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
ccgParser easyccg \
ccgParser.modelFolder lib_data/easyccg_model \
| java -cp bin:lib/* in.sivareddy.graphparser.util.NlpPipeline \
annotators tokenize,ssplit,pos \
tokenize.whitespace true \
ssplit.eolonly true \
languageCode en \
posTagKey UD \
pos.model lib_data/ud-models-v1.3/en/pos-tagger/utb-caseless-en-bidirectional-glove-distsim-lower.tagger \
postprocess.correctPosTags true \
> working/graphquestions.testing.easyccg.forest.json
gq_bow_supervised_without_merge_without_expand:
rm -rf ../working/gq_bow_supervised_without_merge_without_expand
mkdir -p ../working/gq_bow_supervised_without_merge_without_expand
java -Xms2048m -cp bin:lib/* in.sivareddy.graphparser.cli.RunGraphToQueryTrainingMain \
-pointWiseF1Threshold 0.2 \
-semanticParseKey bow_question_graph \
-schema data/freebase/schema/sempre2_schema_gp_format.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 1 \
-useSchema true \
-useKB true \
-ngramGrelPartFlag 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 false \
-useLexiconWeightsRel false \
-useLexiconWeightsType false \
-validQueryFlag true \
-useGoldRelations false \
-evaluateOnlyTheFirstBest false \
-evaluateBeforeTraining false \
-entityScoreFlag true \
-entityWordOverlapFlag false \
-initialEdgeWeight -0.5 \
-initialTypeWeight -2.0 \
-initialWordWeight -0.05 \
-stemFeaturesWeight 0.05 \
-endpoint localhost \
-supervisedCorpus "working/graphquestions.training.plain.forest.json" \
-contentWordPosTags "NOUN;VERB;ADJ;ADP;ADV;PRON" \
-devFile working/graphquestions.testing.plain.forest.json \
-logFile ../working/gq_bow_supervised_without_merge_without_expand/all.log.txt \
> ../working/gq_bow_supervised_without_merge_without_expand/all.txt
gq_ccg_with_hyperexpand.32.stem:
rm -rf ../working/gq_ccg_with_hyperexpand.32.stem
mkdir -p ../working/gq_ccg_with_hyperexpand.32.stem
java -Xms2048m -cp bin:lib/* in.sivareddy.graphparser.cli.RunGraphToQueryTrainingMain \
-pointWiseF1Threshold 0.2 \
-semanticParseKey synPars \
-ccgLexiconQuestions lib_data/lexicon_specialCases_questions_vanilla.txt \
-schema data/freebase/schema/sempre2_schema_gp_format.txt \
-relationTypesFile lib_data/dummy.txt \
-mostFrequentTypesFile data/freebase/stats/freebase_most_frequent_types.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 1 \
-useSchema true \
-useKB true \
-addBagOfWordsGraph false \
-ngramGrelPartFlag true \
-groundFreeVariables false \
-groundEntityVariableEdges false \
-groundEntityEntityEdges false \
-useEmptyTypes false \
-ignoreTypes true \
-urelGrelFlag false \
-urelPartGrelPartFlag false \
-utypeGtypeFlag false \
-gtypeGrelFlag false \
-wordGrelPartFlag true \
-wordGrelFlag false \
-eventTypeGrelPartFlag false \
-argGrelPartFlag true \
-argGrelFlag false \
-questionTypeGrelPartFlag false \
-stemMatchingFlag true \
-mediatorStemGrelPartMatchingFlag true \
-argumentStemMatchingFlag true \
-argumentStemGrelPartMatchingFlag true \
-graphIsConnectedFlag false \
-graphHasEdgeFlag true \
-countNodesFlag false \
-edgeNodeCountFlag false \
-duplicateEdgesFlag true \
-grelGrelFlag true \
-useLexiconWeightsRel false \
-useLexiconWeightsType false \
-validQueryFlag true \
-useAnswerTypeQuestionWordFlag false \
-useGoldRelations false \
-allowMerging false \
-handleEventEventEdges false \
-useExpand false \
-useHyperExpand true \
-evaluateBeforeTraining false \
-entityScoreFlag true \
-entityWordOverlapFlag false \
-initialEdgeWeight -0.5 \
-initialTypeWeight -2.0 \
-initialWordWeight 0.0 \
-stemFeaturesWeight 0.05 \
-endpoint localhost \
-evaluateOnlyTheFirstBest false \
-supervisedCorpus "working/graphquestions.training.easyccg.forest.json" \
-contentWordPosTags "NOUN;VERB;ADJ;ADP;ADV;PRON" \
-devFile working/graphquestions.testing.easyccg.forest.json \
-logFile ../working/gq_ccg_with_hyperexpand.32.stem/all.log.txt \
> ../working/gq_ccg_with_hyperexpand.32.stem/all.txt