From 92e0364f71fab6fdf40f1e8cd9b3b9deff99e88b Mon Sep 17 00:00:00 2001 From: Fred Blain Date: Thu, 25 Jun 2020 20:11:24 +0100 Subject: [PATCH] adding thresholds and QE scores. --- src/service/quality_estimation/qe.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/service/quality_estimation/qe.cpp b/src/service/quality_estimation/qe.cpp index 7b430c7..e6d2d06 100644 --- a/src/service/quality_estimation/qe.cpp +++ b/src/service/quality_estimation/qe.cpp @@ -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