Skip to content

Commit

Permalink
Allow priority score of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mchladek committed Jan 29, 2020
1 parent 7872a99 commit 97e6b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tagnews/senteval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 97e6b9c

Please sign in to comment.