From e7c4ddec1ecab20020645dea399afc464df734c1 Mon Sep 17 00:00:00 2001 From: josh herzberg Date: Tue, 5 Nov 2019 20:20:29 -0600 Subject: [PATCH] min, score --- lib/tagnews/senteval/eval.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tagnews/senteval/eval.py b/lib/tagnews/senteval/eval.py index 3bda9b5..8bd41cb 100644 --- a/lib/tagnews/senteval/eval.py +++ b/lib/tagnews/senteval/eval.py @@ -64,7 +64,8 @@ def is_police_entity(self, entity): def extract_google_priority_bin(article, cpd_model_val, cpd_val): cop_words = sent_evaller().police_words cop_word_counts = sum([article.count(substr) for substr in cop_words]) - score = 0.5 * cpd_val + 0.25 * cpd_model_val + 0.25 * max(cop_word_counts / (2 * len(cop_words)), 1.) + score = 0.5 * cpd_val + 0.25 * cpd_model_val + 0.25 * min(cop_word_counts / (2 * len(cop_words)), 1.) + return score def pre_process_text(html_text):