diff options
author | Matous Machacek <machacekmatous@gmail.com> | 2012-02-28 05:27:23 +0400 |
---|---|---|
committer | Matous Machacek <machacekmatous@gmail.com> | 2012-02-28 05:27:23 +0400 |
commit | ba987c94ba9be5e7c8eb9c3e7c83d8f971fbd3aa (patch) | |
tree | 4140bd7b8fcef62012d2fe59956dcc81bb25c2bd /mert/CderScorer.cpp | |
parent | e38cd12ef3385304a4b363ca9b9ab16ed886a2ff (diff) |
Support for using factors in mert and evaluator
example:
Use --factor "0|2" to use only first and third factor from nbest list and from reference.
If you use interpolated scorer, separate records with comma (e.g. --factor "0|2,1").
Diffstat (limited to 'mert/CderScorer.cpp')
-rw-r--r-- | mert/CderScorer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mert/CderScorer.cpp b/mert/CderScorer.cpp index 2105820e9..424c210b3 100644 --- a/mert/CderScorer.cpp +++ b/mert/CderScorer.cpp @@ -31,6 +31,7 @@ void CderScorer::setReferenceFiles(const vector<string>& referenceFiles) m_ref_sentences.push_back(vector<sent_t>()); string line; while (getline(refin,line)) { + line = this->applyFactors(line); sent_t encoded; TokenizeAndEncode(line, encoded); m_ref_sentences[rid].push_back(encoded); @@ -40,8 +41,10 @@ void CderScorer::setReferenceFiles(const vector<string>& referenceFiles) void CderScorer::prepareStats(size_t sid, const string& text, ScoreStats& entry) { + string sentence = this->applyFactors(text); + vector<int> stats; - prepareStatsVector(sid, text, stats); + prepareStatsVector(sid, sentence, stats); entry.set(stats); } |