Releases: chicago-justice-project/article-tagging
Releases · chicago-justice-project/article-tagging
Police Sentiment v0 in Production
Merge pull request #147 from chicago-justice-project/1.3.1 publish new change
Adding police sentiment
Merge pull request #143 from chicago-justice-project/v1.2.3 up to 1.2.3
Best Location
- adds "is_best" field inside db column trained_location to identify maximally likely location string
- subs out deprecated .ix for .loc
v1.2.0
- 🌎 Update geocoder to CJP-hosted Pelias instance.
- 🏘️ Add support for finding community areas given lat/long.
- ⬆️ Updated Data Loading to match database updates in https://github.com/chicago-justice-project/chicago-justice.
- 🐛 Added more and better tests.
- 📜 Lots of documentation updates.
You can install from pypi with
pip install tagnews
v1.1.0
v1.0.2
- Fixes #92 by correctly listing
h5py
andgeocoder
packages as required for installation insetup.py
. - Adds some lat/long capabilities, but more comprehensive features in this area will come later.
You can pip install from pypi with
pip install tagnews
See the installation guide for more detailed info.
v1.0.1
- BREAKING API changes.
- Now use
tagnews.CrimeTag
instead oftagnews.Tagger
for type-of-crime tagging (name changed to differentiate crime tagging from geo tagging).
- Now use
- Pre-trained model to extract geostrings.
- Use
tagnews.GeoCoder
.
- Use
Example use:
>>> import tagnews
>>> crimetags = tagnews.CrimeTags()
>>> article_text = 'The homicide occurred at the 1700 block of S. Halsted Ave. It happened just after midnight. Another person was killed at the intersection of 55th and Woodlawn, where a lone gunman'
>>> crimetags.tagtext_proba(article_text)
HOMI 0.739159
VIOL 0.146943
GUNV 0.134798
...
>>> crimetags.tagtext(article_text, prob_thresh=0.5)
['HOMI']
>>> geoextractor = tagnews.GeoCoder()
>>> prob_out = geoextractor.extract_geostring_probs(article_text)
>>> list(zip(*prob_out))
[..., ('at', 0.0044685714), ('the', 0.005466637), ('1700', 0.7173856), ('block', 0.81395197), ('of', 0.82227415), ('S.', 0.7940061), ('Halsted', 0.70529455), ('Ave.', 0.60538065), ...]
>>> geoextractor.extract_geostrings(article_text, prob_thresh=0.5)
[['1700', 'block', 'of', 'S.', 'Halsted', 'Ave.'], ['55th', 'and', 'Woodlawn,']]
>>> import os; import psutil
>>> print('Memory usage: {} MB'.format(psutil.Process(os.getpid()).memory_info().rss / (1024 ** 2)))
Memory usage: 524.7265625 MB
You can pip install from pypi with
pip install tagnews
See the installation guide for more detailed info.
v0.6.0
- Code to load GloVe word vectorizer.
- Example of using Google API to geo-tag a location string. (Thanks @m00nd00r)
- Code to load Named Entity Recognition (NER) data downloadable from kaggle.
- Better documentation. (Thanks @jherzberg)
- Fix setup.py requirements. (Thanks @meshulam for pointing the problem out!)
You can pip install from pypi with
pip install tagnews
See the installation guide for more detailed info.