Skip to content

Commit

Permalink
Merge pull request #147 from chicago-justice-project/1.3.1
Browse files Browse the repository at this point in the history
publish new change
  • Loading branch information
jlherzberg authored Feb 5, 2020
2 parents d7b3366 + 97e6b9c commit 2e62689
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/tagnews/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
__all__ = [utils, crimetype, CrimeTags, GeoCoder, SentimentGoogler,
get_lat_longs_from_geostrings, load_data, load_glove]

__version__ = '1.3.0'
__version__ = '1.3.4'
4 changes: 2 additions & 2 deletions lib/tagnews/senteval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def is_police_entity(self, entity):
return entity
return False

def extract_google_priority_bin(self, article, cpd_model_val, cpd_val):
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]
bin = [bin for bin, bin_max_val in enumerate(self.bins) if bin_max_val >= score][-1]
return bin


Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'tagnews.crimetype.models.binary_stemmed_logistic',
'tagnews.geoloc',
'tagnews.geoloc.models.lstm',
'tagnews.senteval',
'tagnews.tests'],
install_requires=['nltk', 'numpy>=1.13', 'scikit-learn==0.19.0', 'pandas', 'scipy',
'tensorflow>=1.4', 'h5py', 'keras', 'shapely', 'requests'],
Expand Down

0 comments on commit 2e62689

Please sign in to comment.