#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include "moses/TrellisPathList.h"
#include "moses/TrellisPath.h"
#include "moses/Util.h"
#include "mbr.h"
Go to the source code of this file.
Functions | |
void | extract_ngrams (const vector< const Factor * > &sentence, map< vector< const Factor * >, int > &allngrams) |
float | calculate_score (const vector< vector< const Factor * > > &sents, int ref, int hyp, vector< map< vector< const Factor * >, int > > &ngram_stats) |
const TrellisPath | doMBR (const TrellisPathList &nBestList, AllOptions const &opts) |
void | GetOutputFactors (const TrellisPath &path, FactorType const oFactor, vector< const Factor * > &translation) |
Variables | |
int | BLEU_ORDER = 4 |
int | SMOOTH = 1 |
float | min_interval = 1e-4 |
float calculate_score | ( | const vector< vector< const Factor * > > & | sents, | |
int | ref, | |||
int | hyp, | |||
vector< map< vector< const Factor * >, int > > & | ngram_stats | |||
) |
Definition at line 52 of file mbr.cpp.
References BLEU_ORDER, and SMOOTH.
Referenced by doMBR().
const TrellisPath doMBR | ( | const TrellisPathList & | nBestList, | |
AllOptions const & | opts | |||
) |
Definition at line 92 of file mbr.cpp.
References Moses::TrellisPathList::at(), Moses::TrellisPathList::begin(), calculate_score(), Moses::TrellisPathList::end(), extract_ngrams(), Moses::ReportingOptions::factor_order, Moses::GetOutputFactors(), Moses::TrellisPath::GetScoreBreakdown(), Moses::TrellisPathList::GetSize(), Moses::AllOptions::mbr, Moses::AllOptions::output, Moses::MBR_Options::scale, Moses::UntransformScore(), and UTIL_THROW_IF2.
Referenced by Moses::Manager::OutputBest().
void extract_ngrams | ( | const vector< const Factor * > & | sentence, | |
map< vector< const Factor * >, int > & | allngrams | |||
) |
Definition at line 38 of file mbr.cpp.
References BLEU_ORDER, and k.
Referenced by doMBR().
void GetOutputFactors | ( | const TrellisPath & | path, | |
FactorType const | oFactor, | |||
vector< const Factor * > & | translation | |||
) |
Definition at line 162 of file mbr.cpp.
References Moses::Hypothesis::GetCurrTargetPhrase(), Moses::TrellisPath::GetEdges(), Moses::Phrase::GetFactor(), and Moses::Phrase::GetSize().
int BLEU_ORDER = 4 |
Definition at line 35 of file mbr.cpp.
Referenced by calculate_score(), Moses::doConsensusDecoding(), and extract_ngrams().
float min_interval = 1e-4 |
int SMOOTH = 1 |
Definition at line 36 of file mbr.cpp.
Referenced by calculate_score(), and Moses::doConsensusDecoding().