From f79018ee3602209746b9c1d7c1bb4919f7ac5ee8 Mon Sep 17 00:00:00 2001 From: josh herzberg Date: Tue, 14 Jan 2020 21:22:52 -0600 Subject: [PATCH] type hint --- 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 3f1f190..f558c8c 100644 --- a/lib/tagnews/senteval/eval.py +++ b/lib/tagnews/senteval/eval.py @@ -63,7 +63,7 @@ def is_police_entity(self, entity): return entity return False - def extract_google_priority_bin(self, article, cpd_model_val=1, cpd_val=1): + 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]