File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
lib/idp_common_pkg/idp_common/classification Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1249,6 +1249,13 @@ def classify_document(self, document: Document) -> Document:
12491249 page_id
12501250 ].confidence = cached_result .classification .confidence
12511251
1252+ # Copy metadata (including boundary information) to the page
1253+ if hasattr (document .pages [page_id ], 'metadata' ):
1254+ document .pages [page_id ].metadata = cached_result .classification .metadata
1255+ else :
1256+ # If the page doesn't have a metadata attribute, add it
1257+ setattr (document .pages [page_id ], 'metadata' , cached_result .classification .metadata )
1258+
12521259 # Merge cached metering data
12531260 page_metering = cached_result .classification .metadata .get (
12541261 "metering" , {}
@@ -1297,6 +1304,13 @@ def classify_document(self, document: Document) -> Document:
12971304 page_id
12981305 ].confidence = page_result .classification .confidence
12991306
1307+ # Copy metadata (including boundary information) to the page
1308+ if hasattr (document .pages [page_id ], 'metadata' ):
1309+ document .pages [page_id ].metadata = page_result .classification .metadata
1310+ else :
1311+ # If the page doesn't have a metadata attribute, add it
1312+ setattr (document .pages [page_id ], 'metadata' , page_result .classification .metadata )
1313+
13001314 # Merge metering data
13011315 page_metering = page_result .classification .metadata .get (
13021316 "metering" , {}
You can’t perform that action at this time.
0 commit comments