+
Skip to content

Conversation

HenryL27
Copy link
Collaborator

@HenryL27 HenryL27 commented Feb 28, 2025

add a model_selection param to hybrid table extractor that accepts expressions in this spec:
(take from the docstring)

        Parse a model selection expression. Model selection expressions are of the form:
            "metric cmp threshold -> model; metric cmp threshold -> model; model;"
        That is, any number of conditional expression selections followed by up to one unconditional
        selection expression, separated by semicolons. Expressions are processed from left to right.

        - Supported metrics are "pixels" - the number of pixels in the larger dimension of the table, and
        "chars" - the number of characters in the table, as detected by the partitioner's text_extractor.
        - Supported comparisons are the usual set - <, >, <=, >=, ==, !=.
        - The threshold must be numeric (and int or a float)
        - The model must be either "deformable_detr" or "table_transformer"

        Args:
            selection: the selection string.

        Returns:
            a function that can be used to select a model given the pixels and chars metrics.

Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Copy link
Contributor

@karanataryn karanataryn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments and suggestions. I like the query syntax, but wonder if this is a bit too complex for a relatively obscure option. We'll need to document this well.

HenryL27 added 2 commits March 3, 2025 12:54
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
Copy link
Contributor

@karanataryn karanataryn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Henry Lindeman <hmlindeman@yahoo.com>
@HenryL27 HenryL27 enabled auto-merge (squash) March 3, 2025 21:30
@HenryL27 HenryL27 merged commit bc51e14 into main Mar 3, 2025
12 of 15 checks passed
@HenryL27 HenryL27 deleted the hml-tableparam branch March 3, 2025 21:47
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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载