summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-25 00:42:45 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-25 00:42:45 +0000
commite45f99a03c6d8e0cf8453aa9419920d0faf741ca (patch)
tree8e22ccff0f37c0490304b4e57ecfd0efd6e68557
parent4cf94b582ea50d2799533c3545eb16845f4795da (diff)
allow --beam_prune=0
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@26 ec762483-ff6d-05da-a07a-a48fb63a330f
-rw-r--r--BUILDING3
-rw-r--r--decoder/cdec.cc4
-rw-r--r--decoder/hg.cc8
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<double>(), "Prune paths from -LM forest before LM rescoring")
- ("beam_prune", po::value<double>(), "Prune paths from +LM forest")
+ ("prelm_beam_prune", po::value<double>(), "Prune paths from -LM forest before LM rescoring, keeping paths within exp(alpha>=0)")
+ ("beam_prune", po::value<double>(), "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<string>(), "(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<bool>& 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<bool>* preserve_mask) {
- assert(alpha > 0.0);
+ assert(alpha >= 0.0);
assert(scale > 0.0);
vector<prob_t> io(edges_.size());
if (use_sum_prod_semiring)
@@ -234,7 +234,7 @@ void Hypergraph::PrintGraphviz() const {
static const string none = "<null>";
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";
}