From 97e6b9cb8f6b8275157c4260a1e66d182c57631c Mon Sep 17 00:00:00 2001 From: Michael Chladek Date: Tue, 28 Jan 2020 19:26:02 -0600 Subject: [PATCH] Allow priority score of 1 --- 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 0112726..b140c1a 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(self.bins) if bin_max_val > score][-1] + bin = [bin for bin, bin_max_val in enumerate(self.bins) if bin_max_val >= score][-1] return bin