Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: beam_threshold is in log_10 and needs to be transformed befo… #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bug fix: beam_threshold is in log_10 and needs to be transformed befo…
…re it's passed the the ttable.
  • Loading branch information
tdomhan committed May 10, 2016
commit beba971260d73f891b67139998d22b3f1ab8a119
2 changes: 1 addition & 1 deletion src/fast_align.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/ttables.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down