diff --git a/src/fast_align.cc b/src/fast_align.cc index f5b594c..4f70249 100644 --- a/src/fast_align.cc +++ b/src/fast_align.cc @@ -421,7 +421,7 @@ int main(int argc, char** argv) { } if (!force_align && !conditional_probability_filename.empty()) { cerr << "conditional probabilities: " << conditional_probability_filename << endl; - s2t.ExportToFile(conditional_probability_filename.c_str(), d, beam_threshold); + s2t.ExportToFile(conditional_probability_filename.c_str(), d, pow(10.0, beam_threshold)); } if (force_align) { istream* pin = &cin; diff --git a/src/ttables.h b/src/ttables.h index a20fcdf..444f90e 100644 --- a/src/ttables.h +++ b/src/ttables.h @@ -149,9 +149,10 @@ class TTable { const double threshold = max_p * BEAM_THRESHOLD; for (auto& it : cpd) { const std::string& b = d.Convert(it.first); - double c = log(it.second); - if (c >= threshold) + if (it.second >= threshold) { + double c = log(it.second); file << a << '\t' << b << '\t' << c << std::endl; + } } } file.close();