diff options
author | armatthews <armatthe@cmu.edu> | 2015-04-09 00:44:09 -0400 |
---|---|---|
committer | armatthews <armatthe@cmu.edu> | 2015-04-09 00:44:09 -0400 |
commit | 9d2a9d727380649310fd1d26b1918e88b8e284d6 (patch) | |
tree | f4d426cd00ab1565a4671c4cc293992fb78c169b /mteval/scorer.cc | |
parent | d18a8f8495ad4c910660be128c0f6843593f4999 (diff) |
added WER as a possible tuning metric
Diffstat (limited to 'mteval/scorer.cc')
-rw-r--r-- | mteval/scorer.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mteval/scorer.cc b/mteval/scorer.cc index fedbca91..4c05dbd8 100644 --- a/mteval/scorer.cc +++ b/mteval/scorer.cc @@ -14,6 +14,7 @@ #include "filelib.h" #include "ter.h" #include "aer_scorer.h" +#include "wer.h" #include "comb_scorer.h" #include "tdict.h" #include "stringlib.h" @@ -46,12 +47,14 @@ ScoreType ScoreTypeFromString(const string& st) { return BLEU_minus_TER_over_2; if (sl == "meteor") return METEOR; + if (sl == "wer") + return WER; cerr << "Don't understand score type '" << st << "', defaulting to ibm_bleu.\n"; return IBM_BLEU; } static char const* score_names[]={ - "IBM_BLEU", "NIST_BLEU", "Koehn_BLEU", "TER", "BLEU_minus_TER_over_2", "SER", "AER", "IBM_BLEU_3", "METEOR" + "IBM_BLEU", "NIST_BLEU", "Koehn_BLEU", "TER", "BLEU_minus_TER_over_2", "SER", "AER", "IBM_BLEU_3", "METEOR", "WER" }; std::string StringFromScoreType(ScoreType st) { @@ -360,6 +363,7 @@ ScorerP SentenceScorer::CreateSentenceScorer(const ScoreType type, case SER: r = new SERScorer(refs);break; case BLEU_minus_TER_over_2: r = new BLEUTERCombinationScorer(refs);break; case METEOR: r = new ExternalSentenceScorer(ScoreServerManager::Instance("meteor"), refs); break; + case WER: r = new WERScorer(refs);break; default: assert(!"Not implemented!"); } @@ -404,6 +408,8 @@ ScoreP SentenceScorer::CreateScoreFromString(const ScoreType type, const string& return BLEUTERCombinationScorer::ScoreFromString(in); case METEOR: return ExternalSentenceScorer::ScoreFromString(ScoreServerManager::Instance("meteor"), in); + case WER: + return WERScorer::ScoreFromString(in); default: assert(!"Not implemented!"); } |