mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
First version of scorer
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1634 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
9c12330785
commit
d794418121
37
mert/Scorer.h
Normal file
37
mert/Scorer.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef __SCORER_H__
|
||||
#define __SCORER_H__
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Scorer {
|
||||
/**
|
||||
* Extract initial statistics from the nbestfile and write them to the stats
|
||||
* file. For example, for bleu these are the ngram counts and length.
|
||||
**/
|
||||
public:
|
||||
|
||||
Scorer(const string& statsfile): _statsfile(statsfile) {}
|
||||
|
||||
virtual void prepare(const vector<string>& referencefiles, const string& nbestfile) {
|
||||
//dummy impl
|
||||
}
|
||||
/**
|
||||
* Calculate the score of the sentences corresponding to the list of candidate
|
||||
* indices. Each index indicates the 1-best choice from the n-best list.
|
||||
**/
|
||||
virtual float score(const vector<unsigned int>& candidates) {
|
||||
//dummy impl
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
string _statsfile;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //__SCORER_H
|
Loading…
Reference in New Issue
Block a user