From 7872a99f03a1800667e953d266a4ea554370e5e8 Mon Sep 17 00:00:00 2001 From: Michael Chladek Date: Mon, 27 Jan 2020 21:07:25 -0600 Subject: [PATCH] Correct bin order --- lib/tagnews/senteval/eval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tagnews/senteval/eval.py b/lib/tagnews/senteval/eval.py index f558c8c..0112726 100644 --- a/lib/tagnews/senteval/eval.py +++ b/lib/tagnews/senteval/eval.py @@ -66,7 +66,7 @@ def is_police_entity(self, entity): def extract_google_priority_bin(self, article:str, cpd_model_val=1, cpd_val=1): cop_word_counts = sum([article.count(substr) for substr in self.police_words]) score = 0.5 * cpd_val + 0.25 * cpd_model_val + 0.25 * min(cop_word_counts / (2 * len(self.police_words)), 1.) - bin = [bin for bin, bin_max_val in enumerate(bins) if bin_max_val > score][0] + bin = [bin for bin, bin_max_val in enumerate(self.bins) if bin_max_val > score][-1] return bin