{ "info": { "author": "Stefan Talpalaru", "author_email": "stefantalpalaru@yahoo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "License :: OSI Approved :: BSD License", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython" ], "description": "description\n-----------\n\nBayesian filtering applied to comment spam.\n\nWhen CAPTCHA can't cut it anymore, Akismet and Disqus are not an option\nand the weasels are closing in it's time to look at how the problem is\ntackled for the biggest spam target of all time: email. Statistical\nanalysis of word frequency in individual messages proved to be simple,\nfast and reliable given enough training data.\n\nThe trick to using a tool designed for emails on comment spam is to\ngenerate email messages on the fly using comment data. Custom email\nheaders allow us to feed bogofilter any field we deem relevant. Training\nis done from the Django admin, moderation with a custom moderation class\nand the app is highly configurable.\n\nusage\n-----\n\n- if you don't have a `custom comments\n app `__,\n make one\n- in your custom comments app subclass your model from\n bogofilter.models.BogofilterComment (it's a proxy model that will not\n add any new fields)\n- subclass your form from bogofilter.forms.BogofilterCommentForm\n- `register `__\n bogofilter.moderation.BogofilterCommentModerator or a subclass of it\n for the model that your comments are attached to. You can do this in\n that app's models.py file with something like this (assuming the\n target model is Entry):\n\n .. code:: python\n\n if Entry not in moderator._registry:\n moderator.register(Entry, BogofilterCommentModerator)\n\n- in admin.py you probably want to change the fields order in your\n custom admin model. Use bogofilter.admin.bogo\\_status as a field for\n list\\_display. Register your admin model subclassed from\n bogofilter.admin.BogofilterCommentsAdmin like this:\n\n .. code:: python\n\n admin.site.unregister(BogofilterComment)\n admin.site.register(MyComment, MyCommentAdmin)\n\n- from the admin, train bogofilter with a batch of wanted (ham) and\n unwanted (spam) comments. 100 of each is a good start. After this\n filter by \"Unsure\" and mark those accordingly. Next filter by\n 'Mismatches'. The assumption is that your ham comments are public,\n while the spam ones are not. Fix any conflict between bogofilter's\n status and your public status by marking the comments as spam or ham.\n- you can pass command line arguments to bogofilter through the\n BOGOFILTER\\_ARGS variable in settings.py:\n\n .. code:: python\n\n BOGOFILTER_ARGS = ['-o', '0.7'] # lower the spam_cutoff from the default 0.95\n\n- if you have use bogofilter for more than one thing in the same\n account, you'll want to specify a directory other than the default\n ~/.bogofilter:\n\n .. code:: python\n\n BOGOFILTER_ARGS = ['-d', './bogofilter_test_dir', '-o', '0.7']\n\ntips\n----\n\n- some spam bots stay only a few seconds on page so they can be weeded\n out based on that. You can get the 'time\\_on\\_page' field from the\n form (it's a floating point timestamp), store it in the model and\n return False from the 'allow' method of the moderator class if it's\n less than a certain value (4 seconds should be enough to avoid false\n negatives).\n- for some reason, moderation signals might get lost and spam comments\n with a .bogotype() of 'S' (spam) or a time on page lower than your\n limit get through. You can deal with those with a periodic task that\n deletes them. I have mine running every 5 minutes and any\n notification related to new comments ignores those newer than that.\n- regularly delete the spam comments after an interval long enough to\n allow you to rescue incorrectly classified ham.\n\nrequirements\n------------\n\n- `Django `__\n- `django-contrib-comments `__\n- `bogofilter `__\n\ntesting\n-------\n\n.. code:: sh\n\n python setup.py test\n\nThe test suite is shamelessly taken from django-contrib-comments and\nconverted to use the 'bogofilter' app wherever possible.\n\nTested with python-2.7.6, python-3.3.4, django-1.6.2,\ndjango-contrib-comments-1.5 and bogofilter-1.2.4 .\n\ncredits\n-------\n\n- author: Stefan Talpalaru stefantalpalaru@yahoo.com\n\n- homepage: https://github.com/stefantalpalaru/django-bogofilter", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/stefantalpalaru/django-bogofilter", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-bogofilter", "package_url": "https://pypi.org/project/django-bogofilter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-bogofilter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/stefantalpalaru/django-bogofilter" }, "release_url": "https://pypi.org/project/django-bogofilter/0.1/", "requires_dist": null, "requires_python": null, "summary": "Bayesian spam filtering for django_comments using bogofilter", "version": "0.1" }, "last_serial": 1049463, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f873a8e51f2df8d69239afbc4f16138f", "sha256": "897dc02742a1c104c43ddbfc1174be5850063eb786d6693a6bad9853404ab0ae" }, "downloads": -1, "filename": "django-bogofilter-0.1.tar.gz", "has_sig": false, "md5_digest": "f873a8e51f2df8d69239afbc4f16138f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20192, "upload_time": "2014-04-02T20:04:26", "url": "https://files.pythonhosted.org/packages/0e/fd/e86be45db7b9c0af8d8c2da292774ca6e6a38a3a24bc1215527e3a593958/django-bogofilter-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f873a8e51f2df8d69239afbc4f16138f", "sha256": "897dc02742a1c104c43ddbfc1174be5850063eb786d6693a6bad9853404ab0ae" }, "downloads": -1, "filename": "django-bogofilter-0.1.tar.gz", "has_sig": false, "md5_digest": "f873a8e51f2df8d69239afbc4f16138f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20192, "upload_time": "2014-04-02T20:04:26", "url": "https://files.pythonhosted.org/packages/0e/fd/e86be45db7b9c0af8d8c2da292774ca6e6a38a3a24bc1215527e3a593958/django-bogofilter-0.1.tar.gz" } ] }