本文整理汇总了C++中TargetPhrase::GetFutureScore方法的典型用法代码示例。如果您正苦于以下问题:C++ TargetPhrase::GetFutureScore方法的具体用法?C++ TargetPhrase::GetFutureScore怎么用?C++ TargetPhrase::GetFutureScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TargetPhrase
的用法示例。
在下文中一共展示了TargetPhrase::GetFutureScore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//TODO this should be a factory function!
TranslationOption::TranslationOption(const WordsRange &wordsRange
, const TargetPhrase &targetPhrase)
: m_targetPhrase(targetPhrase)
, m_inputPath(NULL)
, m_sourceWordsRange(wordsRange)
, m_futureScore(targetPhrase.GetFutureScore())
{
}
示例2: edge
template <class Model> void Fill<Model>::AddPhraseOOV(TargetPhrase &phrase, std::list<TargetPhraseCollection*> &, const WordsRange &)
{
std::vector<lm::WordIndex> words;
CHECK(phrase.GetSize() <= 1);
if (phrase.GetSize())
words.push_back(Convert(phrase.GetWord(0)));
search::PartialEdge edge(edges_.AllocateEdge(0));
// Appears to be a bug that FutureScore does not already include language model.
search::ScoreRuleRet scored(search::ScoreRule(context_.LanguageModel(), words, edge.Between()));
edge.SetScore(phrase.GetFutureScore() + scored.prob * context_.LMWeight() + static_cast<search::Score>(scored.oov) * oov_weight_);
search::Note note;
note.vp = &phrase;
edge.SetNote(note);
edges_.AddEdge(edge);
}
示例3: operator
bool operator() (const TargetPhrase &a, const TargetPhrase &b) {
return a.GetFutureScore() > b.GetFutureScore();
}