mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-17 14:17:13 +03:00
set sortScore even when log prob
This commit is contained in:
parent
7fa586aa9b
commit
1c818b270b
@ -74,6 +74,19 @@ public:
|
||||
protected:
|
||||
};
|
||||
|
||||
template<typename TP>
|
||||
struct CompareSortScore
|
||||
{
|
||||
bool operator()(const TP *a, const TP *b) const
|
||||
{
|
||||
SCORE scoreA = a->sortScore;
|
||||
SCORE scoreB = b->sortScore;
|
||||
|
||||
return scoreA > scoreB;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,18 +75,5 @@ struct CompareFutureScore
|
||||
}
|
||||
};
|
||||
|
||||
template<typename TP>
|
||||
struct CompareSortScore
|
||||
{
|
||||
bool operator()(const TP *a, const TP *b) const
|
||||
{
|
||||
SCORE scoreA = a->sortScore;
|
||||
SCORE scoreB = b->sortScore;
|
||||
|
||||
return scoreA > scoreB;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} /* namespace Moses2a */
|
||||
|
||||
|
@ -591,6 +591,9 @@ SCFG::TargetPhraseImpl *ProbingPT::CreateTargetPhraseSCFG(
|
||||
// set pt score for rule
|
||||
tp->GetScores().PlusEquals(system, *this, scores);
|
||||
|
||||
// sort score. Just for scfg
|
||||
tp->sortScore = (totalNumScores >= 3) ? scores[2] : 0;
|
||||
|
||||
// save scores for other FF, eg. lex RO. Just give the offset
|
||||
if (m_engine->num_lex_scores) {
|
||||
tp->scoreProperties = scores + m_engine->num_scores;
|
||||
|
Loading…
Reference in New Issue
Block a user