Skip to content

Minimum Entropy is a DDL hosted question/answer site for beginners who need answers to Data Science questions.

License

Notifications You must be signed in to change notification settings

DistrictDataLabs/minimum-entropy

Repository files navigation

Minimum Entropy

A question/answer web application to create a data science knowledge base.

Build Status Coverage Status Stories in Ready

Answers 1km

How to Run

In order to run the server locally, follow these steps:

  1. Clone the repository into a working directory of your choice

  2. Install the dependencies using pip install -r requirements.txt

    Note, it may be helpful to use a virtualenv - and you really should.

  3. Set the following environment vars (or use a .env file, see below):

     $ export DJANGO_SETTINGS_MODULE=minent.settings.development
     $ export SECRET_KEY="super secret key"
     $ export GOOGLE_OAUTH2_KEY="googlekey"
     $ export GOOGLE_OAUTH2_SECRET="googlesecret"
    

    Note that this app is enabled with Google OAuth login, you'll need to create your own Google credentials with the Google Developers console.

  4. Create a database on postgres (on the localhost) called minent

    Note, you can set the envvars DB_NAME, DB_USER, DB_PASS etc.

  5. Run the database migration:

     $ python manage.py migrate
    
  6. Run the server:

     $ make runserver
    
  7. You should now be able to open a browser at http://127.0.0.1:8000/

Environment Variables

Although many settings for different deployment environments can be tracked with the codebase in the correct settings file, some variables like passwords and secret keys should be stored in operating system environment for security reasons. I've installed django-dotenv so to manage your development environment, place inside a .env file in the root of the repository with the following required keys:

DJANGO_SETTINGS_MODULE=minent.settings.development
SECRET_KEY=asupersecretpassword
GOOGLE_OAUTH2_CLIENT_ID=ourgoogleclientid
GOOGLE_OAUTH2_CLIENT_SECRET=ourgoogleclientsecret  

Optional environment variables that should be set in the environment in production are as follows (along with their current defaults):

# Specify database information
DB_NAME=minent
DB_USER=django
DB_PASS=
DB_HOST=localhost
DB_PORT=5432

# Specify email logging information (gmail credentials)
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=

About

Minimum Entropy is a fork of Kyudo, a knowledge goal casebase management and annotation tool. Kyudo was designed to create a corpus with which to explore case-based reasoning and automatic knowledge goal solutions in an artificial intelligence setting and was set up similarly to a Q&A application like StackExchange or Quora.

Contributing

Minimum Entropy is open source, and we would love your help to develop the site, particularly if you are a Django or Front-End developer! You can contribute in the following ways:

  1. Add issues or bugs to the bug tracker: https://github.com/DistrictDataLabs/minimum-entropy/issues
  2. Work on a card on the dev board: https://waffle.io/DistrictDataLabs/minimum-entropy
  3. Create a pull request in Github: https://github.com/DistrictDataLabs/minimum-entropy/pulls

The repository is set up in a typical production/release/development cycle as described in A Successful Git Branching Model. Please make sure that all pull requests go into the develop branch; pulls to master will not be considered. A typical workflow is as follows:

  1. Select a card from the dev board - preferably one that is "ready" then move it to "in-progress".

  2. Create a branch off of develop called "feature-[feature name]", work and commit into that branch.

     ~$ git checkout -b feature-myfeature develop
    
  3. Once you are done working (and everything is tested) merge your feature into develop.

     ~$ git checkout develop
     ~$ git merge --no-ff feature-myfeature
     ~$ git branch -d feature-myfeature
     ~$ git push origin develop
    
  4. Repeat. Releases will be routinely pushed into master via release branches, then deployed to the server.

Name Origin

Maximum Entropy is a classification method that is used to predict the probabilities of different possible outcomes of a categorically distributed dependent variable. It uses a principle such that the probability which best represents the current state of knowledge is the one with the largest entropy. Entropy refers to uncertainty, and in a question and answer site, uncertainty is bad. Therefore we've named the site minimum entropy to reflect the fact that we are trying to minimize uncertainty in order to best represent the current state of knowledge.

Attribution

The image used in this README, Answers by Francisco Martins is licensed under CC BY-NC 2.0

Changelog

The release versions that are sent to the Python package index (PyPI) are also tagged in Github. You can see the tags through the Github web application and download the tarball of the version you'd like. Additionally PyPI will host the various releases of Minimum Entropy (eventually).

The versioning uses a three part version system, "a.b.c" - "a" represents a major release that may not be backwards compatible. "b" is incremented on minor releases that may contain extra features, but are backwards compatible. "c" releases are bug fixes or other micro changes that developers should feel free to immediately update to.

Hotfix 1.2.1 Beta 4

A quick hotfix due to a question and answer ordering by vote bug. Also took the chance to add links to the tags in the question list and detail pages as well as to fix the synonym bug (temporarily). Links for the tags are still not rendered after JavaScript editing though.

Version 1.2 Beta 3

The third beta fixes the tag grid system which got all wonky in the first implementation when actual data was put in. The new style is similar to the Stack Overflow tag grid style. Moreover, now tags are case insensitive, which should help eliminate duplicates. The activity stream was also updated to use templates for a bit more robust control. The "answered" activity now takes the answer as a target rather than as a theme, and answers have detail links to the question that they're on.

Version 1.1 Beta 2

The second beta release fixes a couple of bugs with the older profile system, and a lingering topic item from Kyudo. This release goes a bit further and creates a tagging system for questions (replacing topics) and allows for the ordering and search of questions in a more meaningful way. Hopefully this is the last official Beta version and Minimum Entropy can actually start to be used in a more meaningful way.

Version 1.0 Beta 1

This beta release for Version 1.0 simply moves the code over from Kyudo and modifies it to remove the research components and only present a question and answer system. Things are not perfect since the app was designed for a different research project. However, the core functionality - asking questions and answering them with Markdown, as well as up and down voting exists. This is a good start to beta to our faculty to see what they think!