Making it easier to understand and influence new government regulations with Python NLP
A project from the second Debug Politics hackathon in San Francisco. You can see other projects using the regulations.gov API in the regulationsgov organization and their API showcase.
- Create a virtual environment in the project folder with
virtualenv venv
- Activate the virtual environment with
source venv/bin/activate
(orsource venv/Scripts/activate
if you're on Windows) - Install the necessary packages with
pip install requirements.txt
- You'll need to create a MongoDB database and save the connection string and database name to a file called
external_services.py
(in thelib
directory). This file will need the globalsDATABASE
(the name of the mongo database you plan to use) andMONGO_STRING
(the connection string you intend to use), i.e.
MONGO_STRING = 'mongodb://<dbuser>:<dbpassword>@ds127958.mlab.com:27958/'
DATABASE = 'regulately'
REG_API_KEY = '<your_regulations_gov_api_key>'
IBMWatson = '<your_watson_api_key>'
We are using AlchemyLanguageV1
for sentiment analysis of comments on regulations. You can follow the Alchemy Language prerequisites to get an API key and get your development environment set up.