django-moderator

Django Bayesian inference based comment moderation app
Download

django-moderator Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Praekelt Foundation
  • Publisher web site:
  • http://praekelt.com

django-moderator Tags


django-moderator Description

django-moderator is a Django app that integrates Django's comments framework with SpamBayes to classify comments into one of four categories, ham, spam, reported or unsure, based on training by users (see Paul Graham's A Plan for Spam for some background).Users classify comments as reported using a report abuse mechanic. Staff users can then classify these reported comments as ham or spam, thereby training the algorithm to automatically classify similarly worded comments in future. Additionally comments the algorithm fails to clearly classify as either ham or spam will be classified as unsure, allowing staff users to manually classify as well them via admin.Comments classified as spam will have their is_removed field set to True and as such will no longer be visible in comment listings.Comments reported by users will have their is_removed field set to True and as such will no longer be visible in comment listings.Comments classified as ham or unsure will remain unchanged and as such will be visible in comment listings.django-moderator also implements a user friendly admin interface for efficiently moderating comments.Installation1. Install or add django-moderator to your Python path.2. Add moderator to your INSTALLED_APPS setting.3. Install and configure django-likes as described here.4. Add a MODERATOR setting to your project's settings.py file. This setting specifies what classifier storage backend to use (see below) and also classification thresholds: MODERATOR = { 'CLASSIFIER': 'moderator.storage.DjangoClassifier', 'HAM_CUTOFF': 0.3, 'SPAM_CUTOFF': 0.7, 'ABUSE_CUTOFF': 3, } Specifically a HAM_CUTOFF value of 0.3 as in this example specifies that any comment scoring less than 0.3 during Bayesian inference will be classified as ham. A SPAM_CUTOFF value of 0.7 as in this example specifies that any comment scoring more than 0.7 during Bayesian inference will be classified as spam. Anything between 0.3 and 0.7 will be classified as unsure, awaiting further manual staff user classification. Additionally an ABUSE_CUTOFF value of 3 as in this example specifies that any comment receiving 3 or more abuse reports will be classified as reported, awaiting further manual staff user classification. HAM_CUTOFF, SPAM_CUTOFF and ABUSE_CUTOFF can be ommited in which case the default cutoffs are 0.3, 0.7 and 3 respectively.Classifier Storage Backendsdjango-moderator includes two SpamBayes storage backends, moderator.storage.DjangoClassifier and moderator.storage.RedisClassifier respectively.Notemoderator.storage.RedisClassifier is recommended for production environments as it should be much faster than moderator.storage.DjangoClassifier.To use moderator.storage.RedisClassifier as your classifier storage backend specify it in your MODERATOR setting, i.e.:MODERATOR = { 'CLASSIFIER': 'moderator.storage.RedisClassifier', 'CLASSIFIER_CONFIG': { 'host': 'localhost', 'port': 6379, 'db': 0, 'password': None, }, 'HAM_CUTOFF': 0.3, 'SPAM_CUTOFF': 0.7, 'ABUSE_CUTOFF': 3,}You can also create your own backends, in which case take note that the content of CLASSIFIER_CONFIG will be passed as keyword agruments to your backend's __init__ method.UsageOnce correctly configured you can use the classifycomments management command (recommended via a cronjob) to automatically classify comments as either ham, spam or unsure based on previous training, i.e.: ./manage.py classifycommentsUnsure or reported comments can be manually classified as either ham or spam via an inline classifed comments fieldset available on each respective comment's admin change view.Product's homepage


django-moderator Related Software