Skip to content

Commit

Permalink
adding thresholds and QE scores.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredblain committed Jun 25, 2020
1 parent cf7b5f7 commit 92e0364
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/service/quality_estimation/qe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ namespace qe {

/// convert sentence score (log prob) to QE score
int sentence_score2qe_score(const float sentence_score) {
return 42;
// empirically defined thresholds
float thresholds[2] = {-0.24869322, -0.10945034};

if (sentence_score < thresholds[0]) {
return 3;
} else if (sentence_score > thresholds[1]) {
return 1;
} else {
return 2;
}
}

}} // end of namespace marian::qea

0 comments on commit 92e0364

Please sign in to comment.