Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.5.3

- Store routing in LayoutElement

## 1.5.2

### Fix
Expand Down
2 changes: 1 addition & 1 deletion unstructured_inference/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.2" # pragma: no cover
__version__ = "1.5.3" # pragma: no cover
4 changes: 4 additions & 0 deletions unstructured_inference/inference/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@ def get_elements_with_detection_model(
# remote call in the future.
assert self.image is not None
inferred_layout: LayoutElements = self.detection_model(self.image)
routing = inferred_layout.routing
routing_score = inferred_layout.routing_score
inferred_layout = self.detection_model.deduplicate_detected_elements(
inferred_layout,
)
inferred_layout.routing = routing
inferred_layout.routing_score = routing_score

if inplace:
self.elements_array = inferred_layout
Expand Down
2 changes: 2 additions & 0 deletions unstructured_inference/inference/layoutelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class LayoutElements(TextRegions):
element_class_id_map: dict[int, str] = field(default_factory=dict)
text_as_html: np.ndarray = field(default_factory=lambda: np.array([]))
table_as_cells: np.ndarray = field(default_factory=lambda: np.array([]))
routing: str | None = None
routing_score: float | None = None
_optional_array_attributes: list[str] = field(
init=False,
default_factory=lambda: [
Expand Down
Loading