feat: label studio to DoclingDocument transform - #11
Open
cau-git wants to merge 2 commits into
Open
Conversation
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
…n contract Replace the three highest-value geometric heuristics in the Label Studio → DoclingDocument pipeline with explicit annotation-driven lookups: H1 (parent resolution via containment tree): - Build `children_by_parent` dict from `parent_ls_id` on rectangle regions - `_determine_parent` and `_has_unresolved_parent` become direct dict lookups - Remove `build_containment_tree`, `ls_element_to_cvat_element`, `_find_tree_node`, `containment_tree`/`tree_index` fields, and CVATElement/TreeNode imports H2 (table structure discovery via bbox containment): - `_create_table` uses `children_by_parent.get(element.ls_id)` instead of tree walk - Table structure elements still consumed geometrically by `compute_cells` (unchanged) H4 (list boundary detection via level comparison): - `should_terminate_list`: remove level-based fallback — group path is the only boundary signal; element outside active group terminates the list - `shtart_list`: remove level-comparison block; warn on list_item with no group H1 reading order (child paths): - `build_global_reading_order` restructured with DFS splice: child paths (polyline `level > 1`) are spliced immediately after their parent element - Validation warnings for mismatched parent_ls_id and level/path-type mismatches H5 (_process_remaining_children) simplifies naturally: - Elements with no `parent_ls_id` absent from reading order are dropped with a warning instead of silently added at root Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
Contributor
|
✅ DCO Check Passed Thanks @cau-git, all your commits are properly signed off. 🎉 |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a complete toolbox to translate label-studio JSON into DoclingDocument format.