mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
18 lines
530 B
Python
Executable File
18 lines
530 B
Python
Executable File
from django.core.management.base import BaseCommand
|
|
from ...mixins import Renderable
|
|
from ...tasks import train_classifier
|
|
|
|
|
|
class Command(Renderable, 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()
|