paperless-ngx/src/documents/management/commands/document_create_classifier.py
2022-02-27 15:26:41 +01:00

19 lines
500 B
Python

from django.core.management.base import BaseCommand
from ...tasks import train_classifier
class Command(BaseCommand):
help = """
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()