Current section

Files

Jump to
xberg lib xberg layout_strategy.ex
Raw

lib/xberg/layout_strategy.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:ba94fe4cec719c31f8ac484fcc2aba1d30db0f87dea8b1b6d0257417a4a260e2
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Xberg.LayoutStrategy do
@moduledoc """
Which PDF pages the layout model runs on.
Layout detection renders each selected page to a raster and runs ONNX
inference on it, which dominates extraction cost. This controls page
selection; [`LayoutStrategy::Always`] preserves the historical behavior of
running on every page. Wire format is snake_case in all serializers
(JSON, TOML, YAML).
"""
@typedoc "Which PDF pages the layout model runs on."
@type t :: :always | :auto
@always :always
@auto :auto
@doc "Run layout detection unconditionally on every page."
@spec always() :: t()
def always, do: @always
@doc "Pre-screen each page with cheap geometry signals and run the model only on pages likely to benefit (multi-column, table-bearing, figure-heavy, form-like, or rotated pages)."
@spec auto() :: t()
def auto, do: @auto
end