mirror of
https://github.com/marian-nmt/marian.git
synced 2024-11-30 21:39:52 +03:00
fixes #54
This commit is contained in:
parent
f97cdfd77a
commit
62cad1d904
@ -16,9 +16,9 @@ void OutputCollector::Write(long sourceId, const std::string& output)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(mutex_);
|
||||
if (sourceId == nextId_) {
|
||||
*outStrm_ << output << std::flush;
|
||||
LOG(progress, "Best translation {} : {}", sourceId, output);
|
||||
|
||||
*outStrm_ << output << std::endl;
|
||||
|
||||
++nextId_;
|
||||
|
||||
Outputs::const_iterator iter, iterNext;
|
||||
@ -29,8 +29,8 @@ void OutputCollector::Write(long sourceId, const std::string& output)
|
||||
if (currId == nextId_) {
|
||||
// 1st element in the map is the next
|
||||
const string &currOutput = iter->second;
|
||||
*outStrm_ << currOutput << std::flush;
|
||||
LOG(progress, "Best translation {} : {}", currId, currOutput);
|
||||
*outStrm_ << currOutput << std::endl;
|
||||
|
||||
++nextId_;
|
||||
|
||||
|
@ -23,7 +23,6 @@ void Printer(const God &god, const History& history, OStream& out) {
|
||||
if (god.Get<bool>("return-alignment")) {
|
||||
best += GetAlignmentString(GetAlignment(bestTranslation.second));
|
||||
}
|
||||
LOG(progress, "Best translation: {}", best);
|
||||
|
||||
if (god.Get<bool>("n-best")) {
|
||||
std::vector<std::string> scorerNames = god.GetScorerNames();
|
||||
@ -48,15 +47,22 @@ void Printer(const God &god, const History& history, OStream& out) {
|
||||
for(size_t j = 0; j < hypo->GetCostBreakdown().size(); ++j) {
|
||||
out << " " << scorerNames[j] << "= " << hypo->GetCostBreakdown()[j];
|
||||
}
|
||||
|
||||
if(god.Get<bool>("normalize")) {
|
||||
out << " ||| " << hypo->GetCost() / words.size() << std::endl;
|
||||
out << " ||| " << hypo->GetCost() / words.size();
|
||||
}
|
||||
else {
|
||||
out << " ||| " << hypo->GetCost() << std::endl;
|
||||
out << " ||| " << hypo->GetCost();
|
||||
}
|
||||
|
||||
if(i < nbl.size() - 1)
|
||||
out << std::endl;
|
||||
else
|
||||
out << std::flush;
|
||||
|
||||
}
|
||||
} else {
|
||||
out << best << std::endl;
|
||||
out << best << std::flush;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user