paperless-ngx/src/documents/management/commands/document_create_classifier.py

18 lines
486 B
Python
Raw Normal View History

from django.core.management.base import BaseCommand
2020-11-12 21:09:45 +01:00
from ...tasks import train_classifier
2021-02-04 23:40:53 +01:00
class Command(BaseCommand):
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.
""".replace(" ", "")
def __init__(self, *args, **kwargs):
BaseCommand.__init__(self, *args, **kwargs)
def handle(self, *args, **options):
train_classifier()