Skip to content

Conversation

PeterStaar-IBM
Copy link
Contributor

Validating self-consistency of annotations

There are a set of simple rules that can be checked and ensure consistent annotations

        def _validate_to_captions():
            """validate to captions.

            - Make sure the first bbox is a FloatingItem and the subsequent
            are of type caption.
            - Make sure that the to_caption only starts at the beginning of
            a group, if a group is present.
            """
            return True

        def _validate_to_footnotes():
            """validate to footnotes.

            - Make sure the first bbox is a FloatingItem and the subsequent
            are of type footnote.
            - Make sure that the to_caption only starts at the beginning of
            a group, if a group is present.
            """
            return True

        def _validate_captions():
            """validate captions.

            Make sure each caption either is the start of a to_caption or
            has a merge node.
            """
            return True

        def _validate_list_items():
            """validate list items.

            Make sure every list-item has a group or merge point.
            """
            return True

        def _validate_reading_order():
            """validate reading-order.

            Make sure that every bbox has a reading-order point or is
            entirely overlapped with a bbox that has a reading-order.
            """
            return True

        def _validate_merges():
            """validate merges.

            Make sure that all bbox in a merge are of same type
            """
            return True

        def _validate_group():
            """validate groups.

            Make sure that all bbox in a group are of same type
            """
            return True

Copy link

mergify bot commented May 28, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants