Skip to content

Commit

Permalink
bucketing will happen in chicago-justice i think
Browse files Browse the repository at this point in the history
  • Loading branch information
jlherzberg committed Nov 6, 2019
1 parent e831faa commit c6ae60f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tagnews/senteval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from google.cloud.language import enums
from google.cloud.language import types

from tagnews.senteval import police_words


def process_google_result(text):
document = types.Document(content=text, type=enums.Document.Type.PLAIN_TEXT)
Expand All @@ -10,7 +12,7 @@ def process_google_result(text):
for entity in sentiment.entities:
clean_entity = "".join(filter(str.isalpha, entity)).lower()

if clean_entity in ["police", "officer", "cop", "officers", "pigs"]:
if clean_entity in police_words:

for mention in entity.mentions:
return mention.sentiment.score
Expand Down Expand Up @@ -66,8 +68,6 @@ def is_police_entity(self, entity):
return entity
return False

def set_bucket_value(self):
pass

def pre_process_text(html_text):
"""
Expand Down
1 change: 1 addition & 0 deletions lib/tagnews/senteval/police_words.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
police_words = ["police", "officer", "cop", "officers", "pigs"]

0 comments on commit c6ae60f

Please sign in to comment.