Skip to main content

Tools to Detect Anomalous Events and News Related to Entities

Project description

huginn

Named for one of the Norse god Odin's ravens who would gather information for him. A package to facilitate the investigation of anomalous spikes in public interest in an entity, then fetch and summarize news stories relevant to those spikes.

Installation and Setup

Requires Python=3.6

huginn is available on PyPi and installable via pip:

pip install huginn

Spacy models

Download English spacy models by running the following in the command line:

$ python3 -m spacy download en

NYT API Key

This project requires the usage of the New York Times article search API. Request a key at developer.nytimes.com. You'll need to set your NYT API key as a system environment variable. Open the file ~/.bashrc (or ~/.bash_profile if the .bashrc doesn't exist) in any Unix based system (Mac, Ubuntu, etc), and add the following two lines to the end of the file:

# Setting NYT API Key as an environment variable
export NYT_API_KEY="YOUR_KEY_HERE"

Where YOUR_KEY_HEREis your NYT API key, enclosed in quotes.

This is necessary for requesting relevant links for a potential entity's anomalies.

Usage

huginn is based around the Huginn object. A user only need provide the entity that they are interested in.

from huginn import Huginn

point72 = Huginn('Point72')

At this point huginn fetches Google Trends search interest on this entity looking back to 2003. We can then find the most anomalous dates and plot the Google trends search interest with the anomalies:

point72.get_anomalies()
point72.plot_interest_with_anomalies()

We then fetch news articles and relevant information related to our anomalies:

point72.get_articles_info()

Now we can get summaries, either specific to each anomaly or globally:

point72.get_global_summary()
point72.get_articles_info_and_summary_after_LDA()

These require downloading some rather large summarization models to run.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

huginn-0.1.4.tar.gz (82.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

huginn-0.1.4-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file huginn-0.1.4.tar.gz.

File metadata

  • Download URL: huginn-0.1.4.tar.gz
  • Upload date:
  • Size: 82.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200323 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for huginn-0.1.4.tar.gz
Algorithm Hash digest
SHA256 27a729a41d9a307d55186604542ec3220304fe76304c06c3def74173e5cc814f
MD5 78f0fa356befb4231e68daa0e8145b54
BLAKE2b-256 c513e98907eedb275c335954a3b421b5f59380f6e01d31b87455a33d87f1cf19

See more details on using hashes here.

File details

Details for the file huginn-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: huginn-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200323 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for huginn-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 647a2ae47837b1837747a6dcbf208bb1611ab918d2cdaf83627db1d761de11fe
MD5 0a3f576ebe1e14a7e0d1aa23d4ba3589
BLAKE2b-256 055450ecfb44a349da7080eca07c8080223eae822b4a2fa2d8414ff163c0eeda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page