mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
The classifier works with ids now, not names. Minor changes.
This commit is contained in:
@@ -9,7 +9,7 @@ from django.contrib.contenttypes.models import ContentType
|
||||
from django.utils import timezone
|
||||
|
||||
from documents.classifier import DocumentClassifier
|
||||
from ..models import Correspondent, Document, Tag, DocumentType
|
||||
from ..models import Document, Tag
|
||||
|
||||
|
||||
def logger(message, group):
|
||||
@@ -23,11 +23,14 @@ def classify_document(sender, document=None, logging_group=None, **kwargs):
|
||||
global classifier
|
||||
try:
|
||||
classifier.reload()
|
||||
classifier.classify_document(document, classify_correspondent=True, classify_tags=True, classify_type=True)
|
||||
classifier.classify_document(document, classify_correspondent=True, classify_tags=True, classify_document_type=True)
|
||||
except FileNotFoundError:
|
||||
logging.getLogger(__name__).fatal("Cannot classify document, classifier model file was not found.")
|
||||
|
||||
|
||||
def add_inbox_tags(sender, document=None, logging_group=None, **kwargs):
|
||||
inbox_tags = Tag.objects.filter(is_inbox_tag=True)
|
||||
document.tags.add(*inbox_tags)
|
||||
|
||||
|
||||
def run_pre_consume_script(sender, filename, **kwargs):
|
||||
|
Reference in New Issue
Block a user