mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
removed matching model fields, automatic classifier reloading, added autmatic_classification field to matching model
This commit is contained in:
@@ -16,15 +16,17 @@ def logger(message, group):
|
||||
logging.getLogger(__name__).debug(message, extra={"group": group})
|
||||
|
||||
|
||||
classifier = None
|
||||
classifier = DocumentClassifier()
|
||||
|
||||
|
||||
def classify_document(sender, document=None, logging_group=None, **kwargs):
|
||||
global classifier
|
||||
if classifier is None:
|
||||
classifier = DocumentClassifier.load_classifier()
|
||||
try:
|
||||
classifier.reload()
|
||||
classifier.classify_document(document, classify_correspondent=True, classify_tags=True, classify_type=True)
|
||||
except FileNotFoundError:
|
||||
logging.getLogger(__name__).fatal("Cannot classify document, classifier model file was not found.")
|
||||
|
||||
classifier.classify_document(document, classify_correspondent=True, classify_tags=True, classify_type=True)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user