Skip to main content

Django text classifier validation

Project description

Validators and some utility functions for validating fields using a naive bayesian text classifier, provided by TextBlob

Usage

Add this application to your Django project:

INSTALLED_APPS = [
    ...
    'textclassifier',
    ...
]

You’ll also need to set the data file source in your settings:

TEXTCLASSIFIER_DATA_FILE = '/tmp/test.json'

Note

The current implementation is very basic, only allowing for one data file. This will eventually be more configurable, but is just a POC for now.

Data file

The data file needs to be written by hand for now as well. It is read using the TextBlob JSON formatter

The file should use the labels spam and valid:

[
    {"text": "This is spam", "label": "spam"},
    {"text": "This is valid", "label": "valid"}
]

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-textclassifier, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_textclassifier-1.0-py2-none-any.whl (5.7 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-textclassifier-1.0.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page