From 584e9ccb9cd306626b450962b391c1e521ce206d Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Fri, 2 May 2014 12:08:52 -0700 Subject: Automatically generate some rt.ini options --- realtime/mkconfig.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/realtime/mkconfig.py b/realtime/mkconfig.py index 71944080..f9938051 100755 --- a/realtime/mkconfig.py +++ b/realtime/mkconfig.py @@ -59,9 +59,14 @@ def main(): shutil.copy(weights_final, os.path.join(output_d, 'weights.final')) # other options - # TODO: automatically set some things here - with open(os.path.join(output_d, 'rt.ini'), 'w') as rt_ini: - pass + rt_ini = os.path.join(output_d, 'rt.ini') + with open(rt_ini, 'w') as out: + if libcdec_ff_hpyplm_so and corpus_hpyplm: + out.write('hpyplm=true\n') + else: + out.write('hpyplm=false\n') + out.write('metric=ibm_bleu\n') + sys.stderr.write('IMPORTANT: add any additional options such as metric=meteor to {}\n'.format(rt_ini)) if __name__ == '__main__': main() -- cgit v1.2.3 From d1530e378037f310d1759e52b715c266043681ed Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Thu, 8 May 2014 12:11:08 -0400 Subject: turn of span filtering --- decoder/hg_intersect.cc | 2 +- decoder/tree2string_translator.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/decoder/hg_intersect.cc b/decoder/hg_intersect.cc index 31a9a1ce..02f5a401 100644 --- a/decoder/hg_intersect.cc +++ b/decoder/hg_intersect.cc @@ -92,7 +92,7 @@ bool Intersect(const Lattice& target, Hypergraph* hg) { return FastLinearIntersect(target, hg); vector rem(hg->edges_.size(), false); - const RuleFilter filter(target, 15); // TODO make configurable + const RuleFilter filter(target, 9999); // TODO make configurable for (unsigned i = 0; i < rem.size(); ++i) rem[i] = filter(*hg->edges_[i].rule_); hg->PruneEdges(rem, true); diff --git a/decoder/tree2string_translator.cc b/decoder/tree2string_translator.cc index c353f7ca..fafb0d97 100644 --- a/decoder/tree2string_translator.cc +++ b/decoder/tree2string_translator.cc @@ -128,12 +128,14 @@ namespace std { void AddDummyGoalNode(Hypergraph* hg) { static const int kGOAL = -TD::Convert("Goal"); - static TRulePtr kGOAL_RULE(new TRule("[Goal] ||| [X] ||| [1]")); unsigned old_goal_node_idx = hg->nodes_.size() - 1; + int old_goal_cat = hg->nodes_[old_goal_node_idx].cat_; + TRulePtr goal_rule(new TRule("[Goal] ||| [X] ||| [1]")); + goal_rule->f_[0] = old_goal_cat; HG::Node* goal_node = hg->AddNode(kGOAL); goal_node->node_hash = 1; TailNodeVector tail(1, old_goal_node_idx); - HG::Edge* new_edge = hg->AddEdge(kGOAL_RULE, tail); + HG::Edge* new_edge = hg->AddEdge(goal_rule, tail); hg->ConnectEdgeToHeadNode(new_edge, goal_node); } -- cgit v1.2.3