mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-21 12:52:13 -05:00
Attempt to resolve via ordering
This commit is contained in:
parent
fbb768f3ac
commit
3580c4c899
@ -169,7 +169,7 @@ class DocumentClassifier:
|
|||||||
tags__is_inbox_tag=True,
|
tags__is_inbox_tag=True,
|
||||||
)
|
)
|
||||||
.select_related("document_type", "correspondent", "storage_path")
|
.select_related("document_type", "correspondent", "storage_path")
|
||||||
.prefetch_related("tags")
|
.prefetch_related("tags").order_by("pk")
|
||||||
)
|
)
|
||||||
|
|
||||||
# No documents exit to train against
|
# No documents exit to train against
|
||||||
@ -199,12 +199,7 @@ class DocumentClassifier:
|
|||||||
hasher.update(y.to_bytes(4, "little", signed=True))
|
hasher.update(y.to_bytes(4, "little", signed=True))
|
||||||
labels_correspondent.append(y)
|
labels_correspondent.append(y)
|
||||||
|
|
||||||
tags: list[int] = sorted(
|
tags: list[int] = list(doc.tags.filter(matching_algorithm=MatchingModel.MATCH_AUTO).order_by("pk").values_list("pk", flat=True))
|
||||||
tag.pk
|
|
||||||
for tag in doc.tags.filter(
|
|
||||||
matching_algorithm=MatchingModel.MATCH_AUTO,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
hasher.update(tag.to_bytes(4, "little", signed=True))
|
hasher.update(tag.to_bytes(4, "little", signed=True))
|
||||||
labels_tags.append(tags)
|
labels_tags.append(tags)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user