Skip to content

Commit

Permalink
police words in separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
jlherzberg committed Nov 6, 2019
1 parent c6ae60f commit 89287f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tagnews/senteval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def process_google_result(text):
class SentimentGoogler:
def __init__(self):
self.client = self.connect_to_client()
self.polce_words = police_words

def run(self, doc_text):
sentiment_ = self.call_api(doc_text)
Expand Down Expand Up @@ -61,10 +62,10 @@ def is_police_entity(self, entity):
"pigs",
"policeofficer",
]
if entity in possible_responses:
if entity in self.police_words:
return entity
for mention in entity.mentions:
if pre_process_text(mention.text.content) in possible_responses:
if pre_process_text(mention.text.content) in self.police_words:
return entity
return False

Expand Down

0 comments on commit 89287f5

Please sign in to comment.