2018-09-04 14:39:55 +02:00
|
|
|
from django.core.management.base import BaseCommand
|
2020-11-12 21:09:45 +01:00
|
|
|
|
2020-11-09 20:29:02 +01:00
|
|
|
from ...tasks import train_classifier
|
2018-09-04 14:39:55 +02:00
|
|
|
|
|
|
|
|
|
2021-02-04 23:40:53 +01:00
|
|
|
class Command(BaseCommand):
|
2018-09-04 14:39:55 +02:00
|
|
|
|
|
|
|
|
help = """
|
2018-09-25 21:12:47 +02:00
|
|
|
Trains the classifier on your data and saves the resulting models to a
|
|
|
|
|
file. The document consumer will then automatically use this new model.
|
2018-09-04 14:39:55 +02:00
|
|
|
""".replace(" ", "")
|
|
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
|
BaseCommand.__init__(self, *args, **kwargs)
|
|
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
2020-11-09 20:29:02 +01:00
|
|
|
train_classifier()
|