diff --git a/CHANGELOG.md b/CHANGELOG.md index ae0c58f68a..be156126df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,7 @@ ### Fixes - **Fix EN DASH not cleaned by `clean_bullets`**: Added EN DASH (`\u2013`) to `UNICODE_BULLETS` pattern so `clean_bullets` properly removes EN DASH bullet points without requiring `clean_dashes` (fixes #4105) -- **Change `languages` parameter default from `["auto"]` to `None`**: Updated default value in `detect_languages()` and `partition_epub()` functions. Behavior unchanged as `None` is converted to `["auto"]` internally. (fixes #2471) -- Resolve GHSA-58pv-8j8x-9vj2 +- **Fix NameError in paddle_ocr.py**: Added missing import for `LayoutElements` from `unstructured_inference.inference.layoutelement` in `OCRAgentPaddle.get_layout_elements_from_image` method ## 0.18.29 diff --git a/unstructured/partition/utils/ocr_models/paddle_ocr.py b/unstructured/partition/utils/ocr_models/paddle_ocr.py index a2cdcdd5ba..9ea4b94725 100644 --- a/unstructured/partition/utils/ocr_models/paddle_ocr.py +++ b/unstructured/partition/utils/ocr_models/paddle_ocr.py @@ -81,6 +81,8 @@ def get_layout_from_image(self, image: PILImage.Image) -> TextRegions: @requires_dependencies("unstructured_inference") def get_layout_elements_from_image(self, image: PILImage.Image) -> LayoutElements: + from unstructured_inference.inference.layoutelement import LayoutElements + ocr_regions = self.get_layout_from_image(image) # NOTE(christine): For paddle, there is no difference in `ocr_layout` and `ocr_text` in