From e45f99a03c6d8e0cf8453aa9419920d0faf741ca Mon Sep 17 00:00:00 2001 From: graehl Date: Fri, 25 Jun 2010 00:42:45 +0000 Subject: allow --beam_prune=0 git-svn-id: https://ws10smt.googlecode.com/svn/trunk@26 ec762483-ff6d-05da-a07a-a48fb63a330f --- BUILDING | 3 ++- decoder/cdec.cc | 4 ++-- decoder/hg.cc | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/BUILDING b/BUILDING index 77eafdfd..dcb3d45b 100644 --- a/BUILDING +++ b/BUILDING @@ -34,7 +34,8 @@ Instructions for building If you're building on cygwin, their libtool is buggy; this make command works for now: - make LIBS+="-loolm -ldstruct -lmisc -lz" + make LIBS+="-loolm -ldstruct -lmisc -lz -lboost_program_options" \ + CFLAGS+="-Wno-sign-compare" 5) Test diff --git a/decoder/cdec.cc b/decoder/cdec.cc index 114a248d..1d7b43f0 100644 --- a/decoder/cdec.cc +++ b/decoder/cdec.cc @@ -79,8 +79,8 @@ void InitCommandLine(int argc, char** argv, po::variables_map* conf) { ("show_expected_length", "Show the expected translation length under the model") ("show_partition,z", "Compute and show the partition (inside score)") ("show_cfg_search_space", "Show the search space as a CFG") - ("prelm_beam_prune", po::value(), "Prune paths from -LM forest before LM rescoring") - ("beam_prune", po::value(), "Prune paths from +LM forest") + ("prelm_beam_prune", po::value(), "Prune paths from -LM forest before LM rescoring, keeping paths within exp(alpha>=0)") + ("beam_prune", po::value(), "Prune paths from +LM forest, keep paths within exp(alpha>=0)") ("lexalign_use_null", "Support source-side null words in lexical translation") ("tagger_tagset,t", po::value(), "(Tagger) file containing tag set") ("csplit_output_plf", "(Compound splitter) Output lattice in PLF format") diff --git a/decoder/hg.cc b/decoder/hg.cc index b56f1246..025feb7c 100644 --- a/decoder/hg.cc +++ b/decoder/hg.cc @@ -159,7 +159,7 @@ void Hypergraph::PruneEdges(const std::vector& prune_edge, bool run_inside filtered[i] = prune; } } - + TopologicallySortNodesAndEdges(nodes_.size() - 1, &filtered); } @@ -197,7 +197,7 @@ void Hypergraph::BeamPruneInsideOutside( const bool use_sum_prod_semiring, const double alpha, const vector* preserve_mask) { - assert(alpha > 0.0); + assert(alpha >= 0.0); assert(scale > 0.0); vector io(edges_.size()); if (use_sum_prod_semiring) @@ -234,7 +234,7 @@ void Hypergraph::PrintGraphviz() const { static const string none = ""; string rule = (edge.rule_ ? edge.rule_->AsString(false) : none); - cerr << " A_" << ei << " [label=\"" << rule << " p=" << edge.edge_prob_ + cerr << " A_" << ei << " [label=\"" << rule << " p=" << edge.edge_prob_ << " F:" << edge.feature_values_ << "\" shape=\"rect\"];\n"; Hypergraph::TailNodeVector indorder(edge.tail_nodes_.size(), 0); @@ -257,7 +257,7 @@ void Hypergraph::PrintGraphviz() const { //cerr << " " << ni->id_ << "[label=\"" << ni->cat_ << " n=" << ni->id_ // << ",x=" << &*ni -// << ",in=" << ni->in_edges_.size() +// << ",in=" << ni->in_edges_.size() // << ",out=" << ni->out_edges_.size() << "\"];\n"; } -- cgit v1.2.3