Event Detection
A CS Comps Project by Josie Bealle, Laura Biester, Phuong Dinh, Julia Kroll, Josh Lipstone, and Anmol Raina

About


One upon a time, a young visionary by the name of Jeff Ondich sat in his room reading the book Daemon by author Daniel Suarez. The book is about software created by a billionaire game designer and the goal of this software is to monitor current news. If it detects specific events in the news, it sets of a series of actions predetermined by the game designer. Now most people would have read this book and thought “Ah, that’s an interesting book”, but young Jeff detected a lucrative opportunity. He searched far and wide and assembled a team of six innocent college students to help bring this software to reality.

Now, innocent that we were, we did not share Jeff’s dreams of world domination, however we did recognize the potential in such software. Think about the time we spend on articles or newspapers, looking for specific information about an event we are interested in. Instead you could enter a sentence into an app, and the app will notify you if anything about the event pops up in current news. Furthermore it will send you a list of the most relevant articles via text or email. Together, we created a piece of software that will make sure you never have to read the news again.

Team


Results


The following graph shows our F1 scores from our test data set

Setup


Installations

  1. Install Homebrew
  2. Downloader (Run all commands from the root directory of the repository): 1../Setup_Teardown/setup_project.sh -s true - Handles psycopg2, Flask, and PostgreSQL. You may be asked to download the JDK
    1. Note: If postgres failes to create the database (this sometimes happens if the createdb command is executed while postgres is still starting up), run ./Setup_Teardown/setup_project.sh -s true again.
      1. ant -Dprefix='./'
  3. Auto-run: ./Setup_Teardown/install_crontab.sh

Registrations

Create a file in the Utils folder named Secrets.py, with the following text:
import sys; import os
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))
​
from_email = ""
twilio_number = "" #use this format, ex. "+19999999999"
twilio_account_sid = ""
twilio_auth_token = ""
sendgrid_api_key = ""
bitly_api_login = ""
bitly_api_key = ""
  1. Sign up for Twilio. Account SID and Auth Token can be found here. Phone number can be found here. Go here to verify any phone numbers you are going to text if using Trial account.
  2. Sign up for SendGrid (they have to approve you, so it may take a while). After approval, go here, generate an api key, and paste it in (the long secret version that is only displayed when you generate it).
  3. Sign up for bitly. Go here. In the sidebar that pops up, click Advanced Settings -> API Support, and copy and paste in the api login and key displayed.
  4. Input any email address to send from.

Running the Downloader, Validator and Pipeline

  1. Just do it. java -jar pipeline.jar
  2. One of the libraries we use, SEMILAR, has a couple bugs in it that cause occasional null pointer exceptions. These instances are fairly rare and do not affect program execution or performace in the long run.

Running the Web App

  1. Run the application: python3 WebApp/EventDetectionWeb.py
  2. To view the application, navigate to localhost:5000

After Pulling New Code

  1. Update Brew: brew update && brew upgrade
  2. Run Ant: ant -Dprefix='./'

Testing

  1. Execute python3 Utils/Globals.py test
  2. Navigate to the Testing directory.
  3. Unzip articles_test folder. Alternatively, if using your own testing data, you can create your own folder of test articles labeled articles_test.
  4. To use our test database run create_premade_test_db.sh. Alternatively, you can set up an empty test database with setup_project_test.sh.
  5. To run the vaidators and get validation results run java -jar validator.jar -c configuration_test.json from root project directory.
  6. Various testing functions can be found in Testing/Tester.py. Make sure you run all programs from root project directory.
  7. Make sure to execute python3 Utils/Globals.py (no test this time) when you are finished with testing mode.