mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
e8a94a7bd2
example: to interpolate BLEU and CDER use --sctype=BLEU,CDER to specify weights use --scconfig=weights:0.3+0.7 This scorer should replace MergeScorer (which requires mert-moses-multi.pl) soon. Interpolated scorer is more universal and is used in the same way as other scorers.
49 lines
924 B
C++
49 lines
924 B
C++
#ifndef MERT_MERGE_SCORER_H_
|
|
#define MERT_MERGE_SCORER_H_
|
|
|
|
#include <iostream>
|
|
#include <set>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Scorer.h"
|
|
|
|
using namespace std;
|
|
|
|
class PerScorer;
|
|
class ScoreStats;
|
|
|
|
/**
|
|
* Merge scoring.
|
|
*/
|
|
class MergeScorer: public StatisticsBasedScorer {
|
|
public:
|
|
explicit MergeScorer(const string& config = "");
|
|
~MergeScorer();
|
|
|
|
virtual void setReferenceFiles(const vector<string>& referenceFiles);
|
|
virtual void prepareStats(size_t sid, const string& text, ScoreStats& entry);
|
|
|
|
virtual size_t NumberOfScores() const
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
void whoami() const {
|
|
cerr << "I AM MergeScorer" << endl;
|
|
}
|
|
|
|
protected:
|
|
friend class PerScorer;
|
|
virtual float calculateScore(const vector<int>& comps) const;
|
|
|
|
private:
|
|
const int kLENGTH;
|
|
|
|
// no copying allowed
|
|
MergeScorer(const MergeScorer&);
|
|
MergeScorer& operator=(const MergeScorer&);
|
|
};
|
|
|
|
#endif // MERT_MERGE_SCORER_H_
|