#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include "moses/TrellisPathList.h"
#include "moses/TrellisPath.h"
#include "moses/StaticData.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) |
vector< const Factor * > | doMBR (const TrellisPathList &nBestList) |
void | GetOutputFactors (const TrellisPath &path, vector< const Factor * > &translation) |
Variables | |
int | BLEU_ORDER = 4 |
int | SMOOTH = 1 |
int | DEBUG = 0 |
float | min_interval = 1e-4 |
vector<const Factor*> doMBR | ( | const TrellisPathList & | nBestList | ) |
Definition at line 99 of file mbr.cpp.
References Moses::TrellisPathList::at(), Moses::TrellisPathList::begin(), calculate_score(), Moses::TrellisPathList::end(), MosesCmd::extract_ngrams(), MosesCmd::GetOutputFactors(), Moses::TrellisPath::GetScoreBreakdown(), Moses::TrellisPathList::GetSize(), Moses::ScoreComponentCollection::GetWeightedScore(), and Moses::UntransformScore().
void GetOutputFactors | ( | const TrellisPath & | path, | |
vector< const Factor * > & | translation | |||
) |
Definition at line 154 of file mbr.cpp.
References Moses::Hypothesis::GetCurrTargetPhrase(), Moses::TrellisPath::GetEdges(), Moses::Phrase::GetFactor(), and Moses::Phrase::GetSize().
int BLEU_ORDER = 4 |
int DEBUG = 0 |
float min_interval = 1e-4 |